BUG-4490: onTransactionChainFailed return null transaction when closing 81/28681/5
authorClaudio D. Gasparini <cgaspari@cisco.com>
Wed, 21 Oct 2015 15:11:42 +0000 (17:11 +0200)
committerMilos Fabian <milfabia@cisco.com>
Fri, 23 Oct 2015 16:45:08 +0000 (16:45 +0000)
Karaf, causing NPE.

Check if null transaction is received from  onTransactionChainFailed

Change-Id: Iece7abee96d7e4eb94960b173341ff2d56c8e170
Signed-off-by: Claudio D. Gasparini <cgaspari@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilder.java

index d1bda15d141c118d22bd52aa5af9d0dd5b96a678..645bacf49f9c435be74a3288dbc45f604cca8d7b 100644 (file)
@@ -247,7 +247,7 @@ public final class RIBImpl extends DefaultRibReference implements AutoCloseable,
 
     @Override
     public void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction, final Throwable cause) {
-        LOG.error("Broken chain in RIB {} transaction {}", getInstanceIdentifier(), transaction.getIdentifier(), cause);
+        LOG.error("Broken chain in RIB {} transaction {}", getInstanceIdentifier(), transaction != null ? transaction.getIdentifier() : null, cause);
     }
 
     @Override
index 8424c7733c65b7b4b568674106e55a05ce4c3a33..78256ee3aba4b57ca734247ae88a98438cdb4cfa 100644 (file)
@@ -172,7 +172,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements AutoCl
     @Override
     public final void onTransactionChainFailed(final TransactionChain<?, ?> chain, final AsyncTransaction<?, ?> transaction, final Throwable cause) {
         // TODO: restart?
-        LOG.error("Topology builder for {} failed in transaction {}", getInstanceIdentifier(), transaction.getIdentifier(), cause);
+        LOG.error("Topology builder for {} failed in transaction {}", getInstanceIdentifier(), transaction != null ? transaction.getIdentifier() : null, cause);
     }
 
     @Override