-
Notifications
You must be signed in to change notification settings - Fork 1.1k
spanner-jdbc: Fix possible IllegalArgumentException in SingleUseTransaction #6175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spanner-jdbc: Fix possible IllegalArgumentException in SingleUseTransaction #6175
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.
|
...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
...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
|
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? |
|
@skuruppu @olavloite yep, that is a temporary break while we wait for the linkage monitor build to be updated. Fine to merge. |
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