BUG-3043 : fix for transaction closed exception 49/20249/2
authorDana Kutenicsova <dkutenic@cisco.com>
Wed, 13 May 2015 12:44:39 +0000 (14:44 +0200)
committerDana Kutenicsova <dkutenic@cisco.com>
Mon, 18 May 2015 08:31:21 +0000 (10:31 +0200)
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 <dkutenic@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java

index ab8f0e2d61fd6d24fbf55960293688e87f98b605..7c88d4cd324af1283ab2f3457bde0525d7c2752e 100644 (file)
@@ -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);
     }