GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — spanner-jdbc: Fix possible IllegalArgumentException in SingleUseTransaction by olavloite · Pull Request #6175 · googleapis/google-cloud-java

Conversation

@olavloite

@olavloite olavloite commented Aug 27, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olavloite
remove fireAndForget rollback as it could cause an IAE
eb98612
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.
@olavloite
olavloite requested review from kolea2 and skuruppu August 27, 2019 11:06
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 27, 2019
@codecov

codecov Bot commented Aug 27, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #6175 into master will decrease coverage by <.01%.
The diff coverage is 70%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...oogle/cloud/spanner/jdbc/SingleUseTransaction.java 86.5% <70%> (-0.32%) 36 <0> (-3)
.../com/google/cloud/spanner/jdbc/ConnectionImpl.java 82.58% <0%> (-1.12%) 155% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b188bf3...a4a8fc3. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kolea2
kolea2 reviewed Aug 27, 2019
View reviewed changes
Comment thread ...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

skuruppu
skuruppu reviewed Aug 28, 2019
View reviewed changes
Comment thread ...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@olavloite
added comments to clearify how the tx is rollbacked
a4a8fc3
skuruppu
skuruppu approved these changes Aug 28, 2019
View reviewed changes
Comment thread ...gle-cloud-spanner-jdbc/src/main/java/com/google/cloud/spanner/jdbc/SingleUseTransaction.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@skuruppu

skuruppu commented Aug 29, 2019

Copy link
Copy Markdown
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.

Class com.google.api.gax.batching.BatchingDescriptor is not found
  referenced from com.google.cloud.bigtable.data.v2.stub.BigtableBatchingCallSettings (google-cloud-bigtable-0.106.1-SNAPSHOT.jar)
  referenced from com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptorV2 (google-cloud-bigtable-0.106.1-SNAPSHOT.jar)
Class com.google.api.gax.batching.BatchingRequestBuilder is not found
  referenced from com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptorV2 (google-cloud-bigtable-0.106.1-SNAPSHOT.jar)
Class com.google.api.gax.batching.BatcherImpl is not found
  referenced from com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub (google-cloud-bigtable-0.106.1-SNAPSHOT.jar)
Class com.google.api.gax.batching.BatchingCallSettings is not found
  referenced from com.google.cloud.bigtable.data.v2.stub.BigtableBatchingCallSettings (google-cloud-bigtable-0.106.1-SNAPSHOT.jar)
Class com.google.api.gax.batching.BatchingCallSettings$Builder is not found
  referenced from com.google.cloud.bigtable.data.v2.stub.BigtableBatchingCallSettings (google-cloud-bigtable-0.106.1-SNAPSHOT.jar)
Exception in thread "main" com.google.cloud.tools.dependencies.linkagemonitor.LinkageMonitorException: Found 5 new linkage errors
	at com.google.cloud.tools.dependencies.linkagemonitor.LinkageMonitor.run(LinkageMonitor.java:105)
	at com.google.cloud.tools.dependencies.linkagemonitor.LinkageMonitor.main(LinkageMonitor.java:63)

@kolea2, can you confirm whether it's ok to merge this in?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olavloite

olavloite commented Aug 29, 2019

Copy link
Copy Markdown
Contributor Author

@skuruppu I had the same issue with a different PR yesterday and talked to @kolea2 about it. She confirmed that it is unrelated to this

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olavloite
olavloite merged commit 5b77c1f into googleapis:master Aug 29, 2019
@kolea2

kolea2 commented Aug 29, 2019

Copy link
Copy Markdown
Contributor

@skuruppu @olavloite yep, that is a temporary break while we wait for the linkage monitor build to be updated. Fine to merge.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chingor13 chingor13 mentioned this pull request Sep 5, 2019
Release google-cloud-java v0.108.0 #6223
Merged
suztomo pushed a commit to suztomo/google-cloud-java that referenced this pull request Mar 23, 2026
@olavloite
spanner-jdbc: Fix possible IllegalArgumentException in SingleUseTrans…
ae3904f
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@kolea2 kolea2 kolea2 left review comments
@skuruppu skuruppu skuruppu approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@olavloite @skuruppu @kolea2 @googlebot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.