Fix for the Bug 5637 : When closing OutboundQueue close() should go prior to finishSh...
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / connection / AbstractOutboundQueueManager.java
index fdcc1f3e1826a5502529bccef5a3e9942c349ca8..64063943b5dfa8c192df08e3a863ce2d2c758714 100644 (file)
@@ -299,12 +299,14 @@ abstract class AbstractOutboundQueueManager<T extends OutboundQueueHandler, O ex
             LOG.trace("Dequeuing messages to channel {}", parent.getChannel());
             writeAndFlush();
             rescheduleFlush();
-        } else if (currentQueue.finishShutdown()) {
-            close();
-            LOG.debug("Channel {} shutdown complete", parent.getChannel());
         } else {
-            LOG.trace("Channel {} current queue not completely flushed yet", parent.getChannel());
-            rescheduleFlush();
+            close();
+            if (currentQueue.finishShutdown()) {
+               LOG.debug("Channel {} shutdown complete", parent.getChannel());
+            } else {
+               LOG.trace("Channel {} current queue not completely flushed yet", parent.getChannel());
+               rescheduleFlush();
+            }
         }
     }