From: Robert Varga Date: Tue, 19 May 2015 11:45:09 +0000 (+0200) Subject: Do not reschedule flush when channel is up and not writable X-Git-Tag: release/lithium~15 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=491faf19aef765281f32ac787f9fab9a3b459b7d;hp=5430767b0b533d1db017b2c4fce88150ac25f50c;p=openflowjava.git Do not reschedule flush when channel is up and not writable 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 --- diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueManager.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueManager.java index 766abe6a..609e23c1 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueManager.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueManager.java @@ -404,7 +404,7 @@ final class OutboundQueueManager 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");