-
Notifications
You must be signed in to change notification settings - Fork 11.8k
[13.x] Add backoff functionality to DB::transaction()
#58253
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
Conversation
|
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
0659ee9 to
2a60920
Compare
DB::transaction()DB::transaction()
3fe7b70 to
fca33bd
Compare
|
That fuether complicates the implementation. In my opinion you should just wrap the transaction into a |
|
@tpetry I had been thinking similarly, which is why I had left it in draft. |
This PR adds a backoff parameter to
DB::transaction()that allows a delay to be added between deadlock attempts. For example, if there were 3 attempts, there would be 2 delays (between 1-2 and 2-3).The
$backoffparameter can be an integer, array or closure:For non-
sqlsrvSQL Server driver connections backoffs won't work, and an exception is thrown if one is configured.