When sumbmitting multiple transactions after each other
you could get into a state in which a transaction was submitted
and the reference wasn't cleared out in the callback resulting in
attempts to use an already finished transaction.
Change-Id: Iebf6ed10760c106e45c51665c63f45debe7e7063
Signed-off-by: Tomas Cere <tcere@cisco.com>
LOG.trace("{}: Submit[{}} via NETCONF", id, writeTx.getIdentifier());
final CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTx.submit();
+ writeTx = null;
+
final DefaultPromise<Void> promise = new DefaultPromise<>();
Futures.addCallback(submitFuture, new FutureCallback<Void>() {
@Override
public void onSuccess(final Void result) {
promise.success(result);
- writeTx = null;
}
@Override
public void onFailure(@Nonnull final Throwable throwable) {
promise.failure(throwable);
- writeTx = null;
}
});
return promise.future();