Bug 6646 Fix infinite reschedule of flush
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / connection / AbstractOutboundQueueManager.java
index 34df0170b4f34692f9225f757585d0ffbf846613..bec266bb5b5abcf727fc4eb0b3a9ab2cec9bf98a 100644 (file)
@@ -173,7 +173,7 @@ abstract class AbstractOutboundQueueManager<T extends OutboundQueueHandler, O ex
         // Then we start queue shutdown, start counting written messages (so that we don't keep sending messages
         // indefinitely) and failing not completed entries.
         shuttingDown = true;
-        final long entries = currentQueue.startShutdown(ctx.channel());
+        final long entries = currentQueue.startShutdown();
         LOG.debug("Cleared {} queue entries from channel {}", entries, ctx.channel());
 
         // Finally, we schedule flush task that will take care of unflushed entries. We also cover the case,
@@ -301,7 +301,7 @@ abstract class AbstractOutboundQueueManager<T extends OutboundQueueHandler, O ex
             rescheduleFlush();
         } else {
             close();
-            if (currentQueue.finishShutdown()) {
+            if (currentQueue.finishShutdown(parent.getChannel())) {
                LOG.debug("Channel {} shutdown complete", parent.getChannel());
             } else {
                LOG.trace("Channel {} current queue not completely flushed yet", parent.getChannel());