diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2010-10-19 12:54:56 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-10-19 12:54:56 +0100 |
| commit | 207538cf6c52dd624dc5bd76b4a76c0f2755dded (patch) | |
| tree | 9509e789f46c99be569a4fc80fa43d4d4599be33 | |
| parent | aa640ba163b6a25f1c50e4766310d043d37df937 (diff) | |
| download | rabbitmq-server-git-207538cf6c52dd624dc5bd76b4a76c0f2755dded.tar.gz | |
Support the possibility of the message being removed by someone else
| -rw-r--r-- | src/rabbit_msg_store.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 980780c0dd..76148ff4e5 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -498,9 +498,14 @@ client_read3(Server, #msg_location { guid = Guid, file = File }, Defer, read_from_disk(MsgLocation, CState1, DedupCacheEts), Release(), %% this MUST NOT fail with badarg {{ok, Msg}, CState2}; - MsgLocation -> %% different file! + #msg_location {} = MsgLocation -> %% different file! Release(), %% this MUST NOT fail with badarg - client_read1(Server, MsgLocation, Defer, CState) + client_read1(Server, MsgLocation, Defer, CState); + not_found -> %% it seems not to exist. Defer, just to be sure. + try Release() %% this can badarg, same as locked case, above + catch error:badarg -> ok + end, + Defer() end end. |
