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());
}