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: UNAVAILABLE error on first query could cause transaction to get stuck #807

Merged
merged 1 commit into from Jan 17, 2021

Conversation

olavloite
Copy link
Collaborator

If the first query or read operation of a read/write transaction would return UNAVAILABLE for the first element of the result stream, the transaction could get stuck. This was caused by the internal retry mechanism that would wait for the initial attempt to return a transaction, which was never returned as the UNAVAILABLE exception was internally handled by the result stream
iterator.

Fixes #799

…stuck

If the first query or read operation of a read/write transaction would return UNAVAILABLE for
the first element of the result stream, the transaction could get stuck. This was caused by the
internal retry mechanism that would wait for the initial attempt to return a transaction, which
was never returned as the UNAVAILABLE exception was internally handled by the result stream
iterator.

Fixes #799
@olavloite olavloite requested a review from a team as a code owner January 16, 2021 08:01
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Jan 16, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 16, 2021
@codecov
Copy link

codecov bot commented Jan 16, 2021

Codecov Report

Merging #807 (725ce24) into master (1a71e50) will increase coverage by 0.06%.
The diff coverage is 85.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #807      +/-   ##
============================================
+ Coverage     85.01%   85.07%   +0.06%     
+ Complexity     2562     2561       -1     
============================================
  Files           143      143              
  Lines         14015    14053      +38     
  Branches       1341     1345       +4     
============================================
+ Hits          11915    11956      +41     
+ Misses         1537     1534       -3     
  Partials        563      563              
Impacted Files Coverage Δ Complexity Δ
...va/com/google/cloud/spanner/AbstractResultSet.java 83.30% <ø> (+0.03%) 28.00 <0.00> (ø)
.../com/google/cloud/spanner/AbstractReadContext.java 86.86% <82.35%> (-0.22%) 48.00 <1.00> (ø)
...om/google/cloud/spanner/TransactionRunnerImpl.java 85.74% <100.00%> (+0.87%) 9.00 <0.00> (ø)
.../google/cloud/spanner/AbstractLazyInitializer.java 92.85% <0.00%> (-7.15%) 4.00% <0.00%> (-1.00%)
...ain/java/com/google/cloud/spanner/SessionImpl.java 85.38% <0.00%> (-0.51%) 30.00% <0.00%> (ø%)
...ain/java/com/google/cloud/spanner/SessionPool.java 89.15% <0.00%> (+0.32%) 71.00% <0.00%> (ø%)
...m/google/cloud/spanner/connection/SpannerPool.java 86.11% <0.00%> (+1.66%) 31.00% <0.00%> (ø%)

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 1a71e50...725ce24. Read the comment docs.

@thiagotnunes thiagotnunes merged commit c7dc6e6 into master Jan 17, 2021
@thiagotnunes thiagotnunes deleted the unavailable-first-query branch January 17, 2021 22:58
thiagotnunes pushed a commit that referenced this pull request Jan 22, 2021
…stuck (#807)

If the first query or read operation of a read/write transaction would return UNAVAILABLE for
the first element of the result stream, the transaction could get stuck. This was caused by the
internal retry mechanism that would wait for the initial attempt to return a transaction, which
was never returned as the UNAVAILABLE exception was internally handled by the result stream
iterator.

Fixes #799
thiagotnunes pushed a commit to thiagotnunes/java-spanner that referenced this pull request Feb 8, 2021
…stuck (googleapis#807)

If the first query or read operation of a read/write transaction would return UNAVAILABLE for
the first element of the result stream, the transaction could get stuck. This was caused by the
internal retry mechanism that would wait for the initial attempt to return a transaction, which
was never returned as the UNAVAILABLE exception was internally handled by the result stream
iterator.

Fixes googleapis#799
thiagotnunes added a commit that referenced this pull request Feb 9, 2021
…to get stuck (#856)

* fix: UNAVAILABLE error on first query could cause transaction to get stuck (#807)

If the first query or read operation of a read/write transaction would return UNAVAILABLE for
the first element of the result stream, the transaction could get stuck. This was caused by the
internal retry mechanism that would wait for the initial attempt to return a transaction, which
was never returned as the UNAVAILABLE exception was internally handled by the result stream
iterator.

Fixes #799

* chore: re-formats source files

To fix lint errors

* fix: removes unrelated changes

Co-authored-by: Knut Olav Løite <koloite@gmail.com>
thiagotnunes pushed a commit that referenced this pull request May 6, 2021
…stuck (#807)

If the first query or read operation of a read/write transaction would return UNAVAILABLE for
the first element of the result stream, the transaction could get stuck. This was caused by the
internal retry mechanism that would wait for the initial attempt to return a transaction, which
was never returned as the UNAVAILABLE exception was internally handled by the result stream
iterator.

Fixes #799
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.

There is no corresponding google-cloud-go PR.

Changes:

Synchronize new proto/yaml changes.
  PiperOrigin-RevId: 446264416
  Source-Link: googleapis/googleapis@3a976a3

chore(accessapproval): include java generated samples
  testing recent changes in gapic-generator-java 2.7.0 to write generated samples to files
  Source-Link: googleapis/googleapis@0bfcb46
rajatbhatta pushed a commit to rajatbhatta/java-spanner that referenced this pull request Nov 17, 2022
…jdbc to v2.6.4 (googleapis#807)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-spanner-jdbc](https://togithub.com/googleapis/java-spanner-jdbc) | `2.6.3` -> `2.6.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.6.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.6.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.6.4/compatibility-slim/2.6.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.6.4/confidence-slim/2.6.3)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-spanner-jdbc</summary>

### [`v2.6.4`](https://togithub.com/googleapis/java-spanner-jdbc/blob/HEAD/CHANGELOG.md#&#8203;264-httpsgithubcomgoogleapisjava-spanner-jdbccomparev263v264-2022-04-21)

[Compare Source](https://togithub.com/googleapis/java-spanner-jdbc/compare/v2.6.3...v2.6.4)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc).
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.

Spanner: TransactionContext hangs thread indefinitely
2 participants