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

Spanner: Session pool should not retry BeginTransaction if database has been deleted #6789

Conversation

olavloite
Copy link

The session pool could start an infinite loop of prepare session calls (BeginTransaction) if the underlying database has been deleted. Instead, the session pool should detect this situation and not retry the call.

Fixes #6779

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 14, 2019
Copy link

@skuruppu skuruppu left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this issue so quickly.

@codecov
Copy link

codecov bot commented Nov 15, 2019

Codecov Report

Merging #6789 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6789      +/-   ##
============================================
- Coverage     46.37%   46.37%   -0.01%     
- Complexity    28026    28028       +2     
============================================
  Files          2614     2615       +1     
  Lines        288327   288309      -18     
  Branches      33810    33809       -1     
============================================
- Hits         133723   133709      -14     
+ Misses       144339   144334       -5     
- Partials      10265    10266       +1
Impacted Files Coverage Δ Complexity Δ
...oogle/cloud/spanner/jdbc/SingleUseTransaction.java 86% <0%> (-1%) 36% <0%> (-1%)
.../google/cloud/spanner/jdbc/CredentialsService.java 90.47% <0%> (-0.64%) 8% <0%> (-3%)
.../com/google/cloud/pubsub/v1/MessageDispatcher.java 84.61% <0%> (-0.52%) 23% <0%> (ø)
...rc/main/java/com/google/cloud/storage/Storage.java 79.39% <0%> (ø) 0% <0%> (ø) ⬇️
...google/cloud/logging/logback/MDCEventEnhancer.java 83.33% <0%> (ø) 4% <0%> (?)
.../google/cloud/logging/logback/LoggingAppender.java 68.5% <0%> (+4.72%) 30% <0%> (+2%) ⬆️

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 740c755...b585fd5. Read the comment docs.

@olavloite
Copy link
Author

@skuruppu I also added a check for PermissionDenied to the session pool, as that error would cause the exact same problem as NotFound (and the same as in the Go client).

Copy link

@skuruppu skuruppu left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix.

@skuruppu skuruppu merged commit c603336 into googleapis:master Nov 15, 2019
@olavloite olavloite deleted the spanner-stop-retrying-prepare-on-db-deleted branch November 19, 2019 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spanner: Client library sending a high rate of BeginTransaction requests when database is deleted
3 participants