Skip to content

Commit

Permalink
WHISTLE-788: cancel timer when caller goes down
Browse files Browse the repository at this point in the history
  • Loading branch information
James Aimonetti committed Feb 1, 2012
1 parent 6fb2691 commit 0890968
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ecallmgr/src/ecallmgr_amqp_pool_worker.erl
Expand Up @@ -160,9 +160,12 @@ handle_cast({response_recv, JObj}, State) ->
%% {stop, Reason, State}
%% @end
%%--------------------------------------------------------------------
handle_info({'DOWN', Ref, process, Pid, _Info}, #state{status=busy, ref=Ref, parent=Parent}) ->
handle_info({'DOWN', Ref, process, Pid, _Info}, #state{status=busy, ref=Ref, parent=Parent, req_ref=ReqRef}) ->
?LOG_END("requestor (~w) down, giving up on task", [Pid]),

erlang:demonitor(Ref, [flush]),
erlang:cancel_timer(ReqRef),

ecallmgr_amqp_pool:worker_free(Parent, self(), 0),
{noreply, #state{}};

Expand Down

0 comments on commit 0890968

Please sign in to comment.