diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2013-07-02 15:01:10 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2013-07-02 15:01:10 +0100 |
commit | 6a5c3a6c8e8ebcc8e2bbf979bfb81b2409f2442a (patch) | |
tree | 97c11c4558de3c3db9db3a2c722866f04d9dca03 | |
parent | c7bf242421ae71b81c0b892f711c5fe079178245 (diff) | |
download | rabbitmq-server-git-6a5c3a6c8e8ebcc8e2bbf979bfb81b2409f2442a.tar.gz |
Guard aganist the case where a delegate-executed function does some monitoring.
-rw-r--r-- | src/delegate.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/delegate.erl b/src/delegate.erl index 03086a590e..460a48996f 100644 --- a/src/delegate.erl +++ b/src/delegate.erl @@ -204,9 +204,13 @@ handle_cast({invoke, Fun, Grouped}, State = #state{node = Node}) -> handle_info({'DOWN', Ref, process, Object, Info}, State = #state{monitors = Monitors}) -> - WantsMonitor = dict:fetch(Ref, Monitors), - WantsMonitor ! {'DOWN', Ref, process, Object, Info}, - {noreply, State#state{monitors = dict:erase(Ref, Monitors)}, hibernate}; + {noreply, case dict:find(Ref, Monitors) of + {ok, WantsMonitor} -> + WantsMonitor ! {'DOWN', Ref, process, Object, Info}, + State#state{monitors = dict:erase(Ref, Monitors)}; + error -> + State + end, hibernate}; handle_info(_Info, State) -> {noreply, State, hibernate}. |