Skip to content
Permalink
Browse files
fix: SessionNotFound was not retried for AsyncTransactionManager (#552)
  • Loading branch information
olavloite committed Oct 27, 2020
1 parent acf52a2 commit 5969f8313a4df6ece63ee8f14df98cbc8511f026
@@ -66,7 +66,9 @@ public ApiFuture<Void> closeAsync() {
if (txnState == TransactionState.STARTED) {
res = rollbackAsync();
}
txn.close();
if (txn != null) {
txn.close();
}
return MoreObjects.firstNonNull(res, ApiFutures.<Void>immediateFuture(null));
}

@@ -172,7 +174,7 @@ public ApiFuture<Void> apply(Empty input) throws Exception {

@Override
public TransactionContextFuture resetForRetryAsync() {
if (txn == null || !txn.isAborted() && txnState != TransactionState.ABORTED) {
if (txn == null || (!txn.isAborted() && txnState != TransactionState.ABORTED)) {
throw new IllegalStateException(
"resetForRetry can only be called if the previous attempt aborted");
}

0 comments on commit 5969f83

Please sign in to comment.