Skip to content

Commit

Permalink
fix check_out cancel (#540)
Browse files Browse the repository at this point in the history
fix #541
  • Loading branch information
seanmcevoy authored and benoitc committed Nov 9, 2018
1 parent a3a0169 commit 74159da
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hackney_pool.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
queues = dict:new(), % Dest => queue of Froms,
pending = dict:new(),
connections = dict:new(),
sockets = dict:new(),
nb_waiters=0}).
sockets = dict:new()}).


start() ->
Expand Down Expand Up @@ -322,7 +321,7 @@ handle_cast({checkout_cancel, Dest, Ref}, State) ->
case Removed of
true ->
Pending2 = del_pending(Ref, Pending),
{noreply, State#state{queues=Queues2, nb_waiters=Pending2}};
{noreply, State#state{queues=Queues2, pending=Pending2}};
false ->
% we leak the socket here but 'DOWN' will mop up for us when it times out
{noreply, dequeue(Dest, Ref, State)}
Expand Down

0 comments on commit 74159da

Please sign in to comment.