Skip to content
Permalink
Browse files
fix: fix potential unnecessary transaction retry (#337)
A transaction could in some circumstances be retried after an abort using the previous
transaction id. This would cause the retry to abort directly as well, and then start a
new transaction. This extra loop has now been removed.

Fixes #327
  • Loading branch information
olavloite committed Jul 14, 2020
1 parent 26be103 commit 1a4f4fd675a1580c87ad1d53c650a20bd2ff4811
Showing with 1 addition and 1 deletion.
  1. +1 −1 google-cloud-spanner/src/main/java/com/google/cloud/spanner/TransactionRunnerImpl.java
@@ -654,7 +654,7 @@ private <T> T runInternal(final TransactionCallable<T> txCallable) {
new Callable<T>() {
@Override
public T call() {
if (txn.isAborted()) {
if (attempt.get() > 0) {
txn = session.newTransaction();
}
checkState(

0 comments on commit 1a4f4fd

Please sign in to comment.