Do not reschedule flush when channel is up and not writable 14/20714/1
authorRobert Varga <rovarga@cisco.com>
Tue, 19 May 2015 11:45:09 +0000 (13:45 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 19 May 2015 11:45:09 +0000 (13:45 +0200)
Shutdown logic checks removed a ciritical check for channel writability
during reschedule. The problem is that an inactive channel is not
writable, hence we need to check for two conditions.

Change-Id: I2c0a79d5f7b8d9cbaec0eaeb553a6f4ecc74f391
Signed-off-by: Robert Varga <rovarga@cisco.com>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueManager.java

index 766abe6a1d5bd0b3944acab9b24a6505f24e30fe..609e23c16acf52616d113eda51dbc6423f185970 100644 (file)
@@ -404,7 +404,7 @@ final class OutboundQueueManager<T extends OutboundQueueHandler> extends Channel
      * to be writable. May only be called from Netty context.
      */
     private void conditionalFlush() {
-        if (currentQueue.needsFlush()) {
+        if (currentQueue.needsFlush() && (shutdownOffset != null || parent.getChannel().isWritable())) {
             scheduleFlush();
         } else {
             LOG.trace("Queue is empty, no flush needed");