spanner-jdbc: Fix possible IllegalArgumentException in SingleUseTransaction#6175
Merged
olavloite merged 2 commits intogoogleapis:masterfrom Aug 29, 2019
Conversation
The fireAndForgetRollbackAndCloseTxManager method could cause an IllegalArgumentException if it happened to execute after a different method had already closed the TransactionManager. The fireAndForgetRollback method has therefore been removed. This is something that should rather be added to the TransactionManager itself.
Codecov Report
@@ Coverage Diff @@
## master #6175 +/- ##
============================================
- Coverage 47.5% 47.5% -0.01%
+ Complexity 27447 27429 -18
============================================
Files 2523 2523
Lines 274592 274572 -20
Branches 31396 31396
============================================
- Hits 130445 130422 -23
- Misses 134514 134519 +5
+ Partials 9633 9631 -2
Continue to review full report at Codecov.
|
kolea2
reviewed
Aug 27, 2019
...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java
Show resolved
Hide resolved
skuruppu
reviewed
Aug 28, 2019
...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java
Show resolved
Hide resolved
...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java
Show resolved
Hide resolved
skuruppu
approved these changes
Aug 28, 2019
...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java
Show resolved
Hide resolved
Contributor
|
I would merge this but I'm uncertain about this Linkage Monitor failure. I don't think it's related since it's complaining about a Bigtable client gax issue. @kolea2, can you confirm whether it's ok to merge this in? |
Contributor
Author
Contributor
|
@skuruppu @olavloite yep, that is a temporary break while we wait for the linkage monitor build to be updated. Fine to merge. |
suztomo
pushed a commit
to suztomo/google-cloud-java
that referenced
this pull request
Mar 23, 2026
…action (googleapis#6175) * remove fireAndForget rollback as it could cause an IAE The fireAndForgetRollbackAndCloseTxManager method could cause an IllegalArgumentException if it happened to execute after a different method had already closed the TransactionManager. The fireAndForgetRollback method has therefore been removed. This is something that should rather be added to the TransactionManager itself. * added comments to clearify how the tx is rollbacked
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fireAndForgetRollbackAndCloseTxManager method could cause an IllegalArgumentException if it happened to execute after a different method had already closed the TransactionManager. The fireAndForgetRollback method has therefore been removed and replaced with a synchronous rollback call. This will make update statements in autocommit mode that return an error slightly slower than they were, as they will not return until the rollback method has been executed.
The fireAndForgetRollback method is something that should rather be added to the TransactionManager itself.
Fixes this flake: https://source.cloud.google.com/results/invocations/df3b7c34-a981-4dfa-9978-7fa34e290142/targets/cloud-devrel%2Fclient-libraries%2Fjava%2Fgoogle-cloud-java%2Fpresubmit%2Fjava7/log