qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1671203 - /qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java
Date Fri, 03 Apr 2015 22:49:47 GMT
Author: kwall
Date: Fri Apr  3 22:49:47 2015
New Revision: 1671203

URL: http://svn.apache.org/r1671203
Log:
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.

Modified:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java?rev=1671203&r1=1671202&r2=1671203&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingConnection.java
Fri Apr  3 22:49:47 2015
@@ -494,6 +494,10 @@ public class NonBlockingConnection imple
                     byteBuffersWritten++;
                     _buffers.poll();
                 }
+                else
+                {
+                    break;
+                }
             }
 
 
@@ -524,6 +528,10 @@ public class NonBlockingConnection imple
                             byteBuffersWritten++;
                             _buffers.poll();
                         }
+                        else
+                        {
+                            break;
+                        }
                     }
                 }
 
@@ -582,7 +590,7 @@ public class NonBlockingConnection imple
         {
             LOGGER.warn("Send ignored as the connection is already closed");
         }
-        else
+        else if (msg.remaining() > 0)
         {
             _buffers.add(msg);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message