Permalink
Browse files

Delete the downed process from monitors before handing off

  • Loading branch information...
1 parent 93e3882 commit 8c1e17c406a493b09c1f64faec8db6da0bf12b6f @devinus committed Oct 25, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/poolboy.erl
View
@@ -188,12 +188,13 @@ handle_call(_Msg, _From, State) ->
{reply, Reply, State}.
handle_info({'DOWN', Ref, _, _, _}, State) ->
- Waiting = queue:filter(fun ({_, R}) -> R =/= Ref end, State#state.waiting),
case ets:match(State#state.monitors, {'$1', Ref}) of
[[Pid]] ->
- NewState = handle_checkin(Pid, State#state{waiting = Waiting}),
+ true = ets:delete(State#state.monitors, Pid),
+ NewState = handle_checkin(Pid, State),
{noreply, NewState};
[] ->
+ Waiting = queue:filter(fun ({_, R}) -> R =/= Ref end, State#state.waiting),
{noreply, State#state{waiting = Waiting}}
end;
handle_info({'EXIT', Pid, _Reason}, State) ->

0 comments on commit 8c1e17c

Please sign in to comment.