From: Matej Perina Date: Thu, 6 Dec 2018 13:55:43 +0000 (+0100) Subject: close effRibInWriter properly X-Git-Tag: release/neon~118 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=8f516139676a32aafdae06944ea8a0d9fcb42d12;p=bgpcep.git close effRibInWriter properly We cannot close effRibInWriter before we clear tables without graceful restart support. Change-Id: Ife2f76aa4b2a9db991b570c9930084c17aeb2cc0 JIRA:BGPCEP-495 Signed-off-by: Matej Perina --- diff --git a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java index 4f4fb0a2f1..fd568c63c3 100644 --- a/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java +++ b/bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java @@ -415,6 +415,7 @@ public class BGPPeer extends AbstractPeer implements BGPSessionListener { } this.ribWriter.clearTables(Sets.difference(this.tables, forwardingTables)); if (restartingLocally) { + this.effRibInWriter.close(); this.peerRestartStopwatch = Stopwatch.createStarted(); handleSelectionReferralTimer(); this.missingEOT.addAll(this.tables); @@ -507,9 +508,6 @@ public class BGPPeer extends AbstractPeer implements BGPSessionListener { if (!isRestartingGracefully()) { future = terminateConnection(); } else { - if (isLocalRestarting()){ - this.effRibInWriter.close(); - } final Set gracefulTables = getGracefulTables(); this.ribWriter.storeStaleRoutes(gracefulTables); future = this.ribWriter.clearTables(Sets.difference(this.tables, gracefulTables));