summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-03-14 11:43:28 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-03-14 11:43:28 +0000
commit3c7d2c726c05213c6b87f4d348f08cae8b1c613b (patch)
tree9fcf7e12d107aa79874a7073b4324e3dd415d4e3
parentcd6f5726765a763ef822f2e8fa89e1be62998e00 (diff)
parent6a65d9b62a55a896db63706aa015c5523a7182bb (diff)
downloadrabbitmq-server-3c7d2c726c05213c6b87f4d348f08cae8b1c613b.tar.gz
Merge bug26066
-rw-r--r--src/rabbit_msg_store.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl
index 9a4439a7..1562050c 100644
--- a/src/rabbit_msg_store.erl
+++ b/src/rabbit_msg_store.erl
@@ -781,6 +781,7 @@ handle_call({new_client_state, CRef, CPid, MsgOnDiskFun, CloseFDsFun}, _From,
clients = Clients,
gc_pid = GCPid }) ->
Clients1 = dict:store(CRef, {CPid, MsgOnDiskFun, CloseFDsFun}, Clients),
+ erlang:monitor(process, CPid),
reply({IndexState, IndexModule, Dir, GCPid, FileHandlesEts, FileSummaryEts,
CurFileCacheEts, FlyingEts},
State #msstate { clients = Clients1 });
@@ -804,8 +805,6 @@ handle_cast({client_dying, CRef},
handle_cast({client_delete, CRef},
State = #msstate { clients = Clients }) ->
- {CPid, _, _} = dict:fetch(CRef, Clients),
- credit_flow:peer_down(CPid),
State1 = State #msstate { clients = dict:erase(CRef, Clients) },
noreply(remove_message(CRef, CRef, clear_client(CRef, State1)));
@@ -888,6 +887,10 @@ handle_info(sync, State) ->
handle_info(timeout, State) ->
noreply(internal_sync(State));
+handle_info({'DOWN', _MRef, process, Pid, _Reason}, State) ->
+ credit_flow:peer_down(Pid),
+ noreply(State);
+
handle_info({'EXIT', _Pid, Reason}, State) ->
{stop, Reason, State}.