Permalink
Browse files

Use the supervisor the shutdown a worker when it's owner process dies…

…, allowing it to terminate
  • Loading branch information...
1 parent 37bdb57 commit fb7014a1e4594d5250618c9c9d88b85ffde91369 @devinus committed Apr 27, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/poolboy.erl
View
@@ -249,7 +249,8 @@ handle_sync_event(_Event, _From, StateName, State) ->
handle_info({'DOWN', Ref, _, _, _}, StateName, State) ->
case ets:match(State#state.monitors, {'$1', Ref}) of
[[Pid]] ->
- true = exit(Pid, kill),
+ Sup = State#state.supervisor,
+ ok = supervisor:terminate_child(Sup, Pid),
{next_state, StateName, State};
[] ->
{next_state, StateName, State}

0 comments on commit fb7014a

Please sign in to comment.