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
Contributor

@olavloite olavloite commented Jan 16, 2021

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 thiagotnunes Jan 16, 2021
@olavloite olavloite requested a review from as a code owner Jan 16, 2021
@product-auto-label product-auto-label bot added the api: spanner label Jan 16, 2021
@google-cla google-cla bot added the cla: yes label Jan 16, 2021
@codecov
Copy link

@codecov 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
18 of 19 checks passed
@thiagotnunes thiagotnunes deleted the unavailable-first-query branch Jan 17, 2021
thiagotnunes pushed a commit that referenced this issue 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 issue 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 issue 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 issue 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants