[#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.
This commit is contained in:
Norman Maurer 2015-06-12 06:19:10 +02:00
parent f5fd34e4ba
commit 8925fe4228

View File

@ -264,7 +264,7 @@ public final class FixedChannelPool extends SimpleChannelPool {
} }
private void runTaskQueue() { private void runTaskQueue() {
while (acquiredChannelCount <= maxConnections) { while (acquiredChannelCount < maxConnections) {
AcquireTask task = pendingAcquireQueue.poll(); AcquireTask task = pendingAcquireQueue.poll();
if (task == null) { if (task == null) {
break; break;