-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(NODE-7122): exponential backoff between retries in convenient transaction API #4765
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
base: main
Are you sure you want to change the base?
Conversation
test/integration/transactions-convenient-api/transactions-convenient-api.prose.test.ts
Outdated
Show resolved
Hide resolved
b6c76a9 to
7ac265d
Compare
4073776 to
3dad6c2
Compare
| @@ -1,3 +1,5 @@ | |||
| import { setTimeout } from 'timers/promises'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we implement this without using Node's API? I feel like adding this conflicts with our Pluggable IO epic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setTimeout is out of scope for the project and we have many other usages of this API in the driver, so I'd prefer not to diverge from what the driver already does.
Description
Summary of Changes
This PR adds exponential backoff between convenient transaction API failures if the transaction must be restarted.
Release Highlight
withTransactionnow applies exponential backoff during transaction retriesThe convenient transaction API now uses exponential backoff between retries, if a transaction must be retried. Under scenarios of high server load, this can prevent transaction retry storms.
Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript