From 8925fe4228392ff0e12d42d1797232497e2c57a5 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 12 Jun 2015 06:19:10 +0200 Subject: [PATCH] [#3881] FixedChannelPool creates 1 more channel than maxConnections Motivation: FixedChannelPool should enforce a number of maximal used channels, but due a bug we fail to correctly enforce this. Modifications: Change check to correctly only acquire channel if we not hit the limit yet. Result: Correct limiting. --- .../src/main/java/io/netty/channel/pool/FixedChannelPool.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java b/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java index 1066358dd6..ddafebb8d3 100644 --- a/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java +++ b/transport/src/main/java/io/netty/channel/pool/FixedChannelPool.java @@ -264,7 +264,7 @@ public final class FixedChannelPool extends SimpleChannelPool { } private void runTaskQueue() { - while (acquiredChannelCount <= maxConnections) { + while (acquiredChannelCount < maxConnections) { AcquireTask task = pendingAcquireQueue.poll(); if (task == null) { break;