BUG-4689: Advertising performance fix II 39/33239/2
authorMilos Fabian <milfabia@cisco.com>
Wed, 20 Jan 2016 12:01:23 +0000 (13:01 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 22 Jan 2016 09:50:03 +0000 (09:50 +0000)
When AdjRibOutListener get a notification with too many changes,
it can fill output buffer with wrtitten Update messages,
without a chance to flush a socket, because the AdjRibOutListener
is blocked when channel is not writable - deadlock situation until a
savior (KA message) will not be send.
Flushing with every write operation is uneffective, hence try to call
the "flush" in a situation when the channel become unwritable.

Change-Id: Ie50b9154d1166d55308c3438c12b9c1b9d3ce19f
Signed-off-by: Milos Fabian <milfabia@cisco.com>
(cherry picked from commit 095c87da7d565dac2cffa11710e7dd0e4a67c20f)

bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ChannelOutputLimiter.java

index 3a610b6221eb725b8c80bd0d08d9fae15728d72c..21150b9431bc9b6fddeb25ac645425edae7deec7 100644 (file)
@@ -71,6 +71,8 @@ final class ChannelOutputLimiter extends ChannelInboundHandlerAdapter {
 
             if (w) {
                 this.notifyAll();
+            } else {
+                flush();
             }
         }