Permalink
Browse files

Ensure the worker supervisor terminates when you stop poolboy

  • Loading branch information...
1 parent 0deace6 commit 17ee86c03f8b0d4d0e93ddc40a2b6d39b29b09e8 @Vagabond Vagabond committed Sep 19, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/poolboy.erl
View
3 src/poolboy.erl
@@ -148,7 +148,8 @@ handle_sync_event(get_avail_workers, _From, StateName, #state{workers=Workers}=S
handle_sync_event(get_all_workers, _From, StateName, #state{worker_sup=Sup}=State) ->
WorkerList = supervisor:which_children(Sup),
{reply, WorkerList, StateName, State};
-handle_sync_event(stop, _From, _StateName, State) ->
+handle_sync_event(stop, _From, _StateName, #state{worker_sup=Sup}=State) ->
+ exit(Sup, shutdown),
{stop, normal, ok, State};
handle_sync_event(_Event, _From, StateName, State) ->
Reply = {error, invalid_message},

0 comments on commit 17ee86c

Please sign in to comment.