summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2015-04-03 22:49:47 +0000
committerKeith Wall <kwall@apache.org>2015-04-03 22:49:47 +0000
commit98d5e956d080eb15f0ec660ed58458ccf35fb2a5 (patch)
treedcb4ed1e0ed05b27b907f82f6a0a2265e538f270
parent8bcfb7bb278644a547bddf4719265d806ea69d72 (diff)
downloadqpid-python-98d5e956d080eb15f0ec660ed58458ccf35fb2a5.tar.gz
QPID-6429: [Java Broker] Discard only ByteBuffers that have been sent down the wire.
In #dowrite, the algorithm means to poll off only the ByteBuffers that have been completely sent down the wire, however it is missing a break. The effect of this is, if we have back pressure and send has been called with an empty ByteBuffer, it can poll away ByteBuffers from the front of the queue that are have content. The Python EchoTests demonstrate the bug because they a) use messages that are sufficient large to cause the client to exert back pressure and b) there are no messages in the properties so send is called with an empty ByteBuffer. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1671203 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java
index 8cec751825..551d1c5bae 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java
@@ -494,6 +494,10 @@ public class NonBlockingConnection implements NetworkConnection, ByteBufferSende
byteBuffersWritten++;
_buffers.poll();
}
+ else
+ {
+ break;
+ }
}
@@ -524,6 +528,10 @@ public class NonBlockingConnection implements NetworkConnection, ByteBufferSende
byteBuffersWritten++;
_buffers.poll();
}
+ else
+ {
+ break;
+ }
}
}
@@ -582,7 +590,7 @@ public class NonBlockingConnection implements NetworkConnection, ByteBufferSende
{
LOGGER.warn("Send ignored as the connection is already closed");
}
- else
+ else if (msg.remaining() > 0)
{
_buffers.add(msg);
}