From bc4800149f6b6fa1a5d1504ecaa43ae6e51f8e74 Mon Sep 17 00:00:00 2001 From: Roland Kuhn Date: Tue, 12 Jan 2016 16:45:53 +0100 Subject: [PATCH] #19094 fix double pull in PoolConductor --- .../scala/akka/http/impl/engine/client/PoolConductor.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolConductor.scala b/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolConductor.scala index 24d9666de6..fec971f3f8 100644 --- a/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolConductor.scala +++ b/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolConductor.scala @@ -140,15 +140,16 @@ private object PoolConductor { slotStates(slotIx) = slotStateAfterDisconnect(slotStates(slotIx), failed) } pull(slotIn) - val tryPull = nextSlot == -1 + val wasBlocked = nextSlot == -1 nextSlot = bestSlot() - if (tryPull) tryPullCtx() + val nowUnblocked = nextSlot != -1 + if (wasBlocked && nowUnblocked) pull(ctxIn) // get next request context } }) setHandler(out, eagerTerminateOutput) - val tryPullCtx = () ⇒ if (nextSlot != -1) pull(ctxIn) + val tryPullCtx = () ⇒ if (nextSlot != -1 && !hasBeenPulled(ctxIn)) pull(ctxIn) override def preStart(): Unit = { pull(ctxIn)