summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2010-10-19 12:54:56 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2010-10-19 12:54:56 +0100
commit207538cf6c52dd624dc5bd76b4a76c0f2755dded (patch)
tree9509e789f46c99be569a4fc80fa43d4d4599be33 /src
parentaa640ba163b6a25f1c50e4766310d043d37df937 (diff)
downloadrabbitmq-server-git-207538cf6c52dd624dc5bd76b4a76c0f2755dded.tar.gz
Support the possibility of the message being removed by someone else
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_msg_store.erl9
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.