Skip to content
Browse files

Ensure the worker supervisor terminates when you stop poolboy

  • Loading branch information...
1 parent 0deace6 commit 17ee86c03f8b0d4d0e93ddc40a2b6d39b29b09e8 @Vagabond Vagabond committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/poolboy.erl
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.
Something went wrong with that request. Please try again.