BGPCEP-766: Reduce synchornization 59/69659/1
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 16 Mar 2018 08:56:29 +0000 (09:56 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 20 Mar 2018 09:27:59 +0000 (10:27 +0100)
under AbstractTopologySessionListener

Change-Id: I99efef02cef6f9af761c73d57bb4b37e50177830
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java

index cdb6212d461bc6ab8fd30d246d9e60752f315a7d..e4eea25bd3958d1817d644d71186b081c8eab771 100755 (executable)
@@ -285,19 +285,16 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
         Futures.addCallback(ctx.trans.submit(), new FutureCallback<Void>() {
             @Override
             public void onSuccess(final Void result) {
-                synchronized (AbstractTopologySessionListener.this) {
-                    LOG.trace("Internal state for session {} updated successfully", psession);
-                    ctx.notifyRequests();
-                }
+                LOG.trace("Internal state for session {} updated successfully", psession);
+                ctx.notifyRequests();
+
             }
 
             @Override
             public void onFailure(final Throwable throwable) {
-                synchronized (AbstractTopologySessionListener.this) {
-                    LOG.error("Failed to update internal state for session {}, closing it", psession, throwable);
-                    ctx.notifyRequests();
-                    psession.close(TerminationReason.UNKNOWN);
-                }
+                LOG.error("Failed to update internal state for session {}, closing it", psession, throwable);
+                ctx.notifyRequests();
+                psession.close(TerminationReason.UNKNOWN);
             }
         }, MoreExecutors.directExecutor());
     }