summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-02-15 15:48:16 +0000
committerMatthew Sackman <matthew@lshift.net>2010-02-15 15:48:16 +0000
commitfb3049db75b4aaa1f54b431db42dfcfd4af4ffd4 (patch)
treebf37616e23c80ba76f777f2f9af4c31c6503a02f /src
parentdc9bf08b21dedbf4f2cfee557229f09f6471c0a7 (diff)
downloadrabbitmq-server-git-fb3049db75b4aaa1f54b431db42dfcfd4af4ffd4.tar.gz
Yet another API consistency design win for the Erlang OTP team. ets:update_counter throws badarg if the key doesn't exist. ets:update_element returns false if the key doesn't exist. The bizarre error that I've been tracking down for a week, and have still not replicated (but was a badmatch false (which means it's likely that it should have been true)) is almost certainly this.
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_msg_store.erl14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index 2db3c34e9b..6be4358cf8 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -1216,16 +1216,10 @@ maybe_compact(State) ->
State.
mark_handle_to_close(File) ->
- lists:foldl(
- fun ({Key, open}, true) ->
- try
- true = ets:update_element(?FILE_HANDLES_ETS_NAME,
- Key, {2, close})
- catch error:badarg -> %% client has deleted concurrently, no prob
- true
- end
- end,
- true, ets:match_object(?FILE_HANDLES_ETS_NAME, {{'_', File}, open})).
+ [ ets:update_element(?FILE_HANDLES_ETS_NAME, Key, {2, close})
+ || {Key, open} <- ets:match_object(?FILE_HANDLES_ETS_NAME,
+ {{'_', File}, open}) ],
+ true.
find_files_to_gc(_N, '$end_of_table') ->
undefined;