From 77a0e038cc72358e0c98bd207febfef38186a9a6 Mon Sep 17 00:00:00 2001 From: Dana Kutenicsova Date: Wed, 13 May 2015 14:44:39 +0200 Subject: [PATCH] BUG-3043 : fix for transaction closed exception When the peer got session down, transaction chain was closed. This caused problems, when the peer reconnected. Moved closing of transaction chaining to when the peer closes. Change-Id: I7da35d7e0a2238f38b5a549e9848b418d467d27a Signed-off-by: Dana Kutenicsova --- .../java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ab8f0e2d61..7c88d4cd32 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 @@ -97,6 +97,7 @@ public class BGPPeer implements ReusableBGPPeer, Peer, AutoCloseable, BGPPeerRun @Override public synchronized void close() { dropConnection(); + this.chain.close(); // TODO should this perform cleanup ? } @@ -195,7 +196,6 @@ public class BGPPeer implements ReusableBGPPeer, Peer, AutoCloseable, BGPPeerRun private synchronized void cleanup() { // FIXME: BUG-196: support graceful restart this.ribWriter.cleanTables(this.tables); - this.chain.close(); this.tables.clear(); } @@ -298,6 +298,7 @@ public class BGPPeer implements ReusableBGPPeer, Peer, AutoCloseable, BGPPeerRun public void onTransactionChainFailed(final TransactionChain chain, final AsyncTransaction transaction, final Throwable cause) { LOG.error("Transaction chain failed.", cause); this.dropConnection(); + this.chain.close(); this.chain = this.rib.createPeerChain(this); } -- 2.36.6