Skip to content

Commit

Permalink
fix: SessionNotFound was not retried for AsyncTransactionManager (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Oct 27, 2020
1 parent acf52a2 commit 5969f83
Show file tree
Hide file tree
Showing 6 changed files with 608 additions and 158 deletions.
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 5969f83

Please sign in to comment.