Skip to content
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

fix: fix aborted handling of batchUpdateAsync #421

Merged
merged 1 commit into from Sep 11, 2020

Conversation

olavloite
Copy link
Collaborator

If a transaction is aborted before a batchUpdateAsync call, the RPC will return an Aborted status. This status was not translated to a com.google.cloud.spanner.AbortedException, but was instead returned as a com.google.api.gax.rpc.AbortedException, which could cause retry handling to fail.

Fixes GoogleCloudPlatform/java-docs-samples#3634

@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 10, 2020
@codecov
Copy link

codecov bot commented Sep 10, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@45d8419). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #421   +/-   ##
=========================================
  Coverage          ?   82.16%           
  Complexity        ?     2455           
=========================================
  Files             ?      136           
  Lines             ?    13589           
  Branches          ?     1307           
=========================================
  Hits              ?    11166           
  Misses            ?     1895           
  Partials          ?      528           
Impacted Files Coverage Δ Complexity Δ
...om/google/cloud/spanner/TransactionRunnerImpl.java 86.08% <100.00%> (ø) 9.00 <0.00> (?)
.../google/cloud/spanner/SpannerExceptionFactory.java 71.79% <0.00%> (ø) 33.00% <0.00%> (?%)
...n/java/com/google/cloud/spanner/SessionClient.java 91.26% <0.00%> (ø) 15.00% <0.00%> (?%)
.../com/google/cloud/spanner/v1/stub/SpannerStub.java 5.88% <0.00%> (ø) 1.00% <0.00%> (?%)
...r/src/main/java/com/google/cloud/spanner/Type.java 93.20% <0.00%> (ø) 59.00% <0.00%> (?%)
...anner/admin/database/v1/DatabaseAdminSettings.java 15.94% <0.00%> (ø) 2.00% <0.00%> (?%)
.../main/java/com/google/cloud/spanner/Operation.java 73.97% <0.00%> (ø) 19.00% <0.00%> (?%)
...panner/connection/AbstractMultiUseTransaction.java 93.75% <0.00%> (ø) 7.00% <0.00%> (?%)
...nner/admin/database/v1/stub/DatabaseAdminStub.java 3.70% <0.00%> (ø) 1.00% <0.00%> (?%)
...a/com/google/cloud/spanner/SpannerRetryHelper.java 68.18% <0.00%> (ø) 3.00% <0.00%> (?%)
... and 127 more

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 45d8419...a506839. Read the comment docs.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Sep 10, 2020
Copy link
Contributor

@thiagotnunes thiagotnunes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olavloite olavloite merged commit 6154008 into master Sep 11, 2020
@olavloite olavloite deleted the fix-aborted-handling-for-batch-update-async branch September 11, 2020 05:58
ansh0l pushed a commit to ansh0l/java-spanner that referenced this pull request Nov 10, 2022
This is an auto-generated regeneration of the .pb.go files by
cloud.google.com/go/internal/gapicgen. Once this PR is submitted, genbot will
update the corresponding PR to depend on the newer version of go-genproto, and
assign reviewers. Whilst this or any regen PR is open in go-genproto, genbot
will not create any more regeneration PRs. If all regen PRs are closed,
gapicgen will create a new set of regeneration PRs once per night.

If you have been assigned to review this PR, please:

- Ensure that CI is passing. If it's failing, it requires your manual attention.
- Approve and submit this PR if you believe it's ready to ship. That will prompt
genbot to assign reviewers to the google-cloud-go PR.

Corresponding google-cloud-go PR: googleapis/google-cloud-go#2667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

com.example.spanner.AsyncExamplesIT: asyncTransactionManager_shouldUpdateRows failed
2 participants