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: SessionNotFound was not retried for AsyncTransactionManager #552

Merged
merged 1 commit into from Oct 27, 2020

Conversation

olavloite
Copy link
Contributor

@olavloite olavloite commented Oct 26, 2020

SessionNotFoundException was not retried if these happened when using AsyncTransactionManager. These exceptions are now handled explicitly in the following way:

  1. The underlying session that is used for the transaction is replaced with a new session from the pool.
  2. The SessionNotFoundException is translated to an AbortedException, which again will be retried, assuming that the client application has implemented a normal retry loop, as is required when using an AsyncTransactionManager.

@olavloite olavloite requested a review from as a code owner Oct 26, 2020
@google-cla google-cla bot added the cla: yes label Oct 26, 2020
@olavloite olavloite requested a review from thiagotnunes Oct 26, 2020
Copy link
Contributor

@thiagotnunes thiagotnunes left a comment

LGTM

@codecov
Copy link

@codecov codecov bot commented Oct 27, 2020

Codecov Report

Merging #552 into master will increase coverage by 0.13%.
The diff coverage is 89.10%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #552      +/-   ##
============================================
+ Coverage     83.93%   84.06%   +0.13%     
- Complexity     2501     2504       +3     
============================================
  Files           141      141              
  Lines         13766    13806      +40     
  Branches       1315     1317       +2     
============================================
+ Hits          11554    11606      +52     
+ Misses         1667     1654      -13     
- Partials        545      546       +1     
Impacted Files Coverage Δ Complexity Δ
...gle/cloud/spanner/AsyncTransactionManagerImpl.java 70.42% <33.33%> (-1.01%) 12.00 <1.00> (ø)
...ain/java/com/google/cloud/spanner/SessionPool.java 88.33% <88.46%> (+1.43%) 71.00 <0.00> (ø)
...ud/spanner/SessionPoolAsyncTransactionManager.java 86.55% <100.00%> (+1.64%) 11.00 <1.00> (+2.00)
.../google/cloud/spanner/SpannerExceptionFactory.java 82.92% <0.00%> (+2.43%) 40.00% <0.00%> (+1.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 d92b7c2...f0eb6d0. Read the comment docs.

@thiagotnunes thiagotnunes merged commit 5969f83 into master Oct 27, 2020
21 checks passed
@thiagotnunes thiagotnunes deleted the async-tx-manager-session-retry branch Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants