-
Notifications
You must be signed in to change notification settings - Fork 100
Add transaction retries. #683
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
CaseyHillers
left a comment
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.
LGTM with nit! This is a great utility function to have available in the backend.
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.
I think we should add these as optional parameters to the function with these as the default values. It could be useful to modify these if there are some operations we want to modify this on.
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.
Done, added them as optional parameters.
keyonghan
left a comment
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.
LGTM!
digiter
left a comment
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.
LGTM with nits: I would try to reduce the number of nesting scopes, to improve readability.
Most of the 500 errors in the backend are related to failing transactions. This change adds retries with quadratic backoffs to remove the flakiness. Bugs: flutter/flutter#42524 flutter/flutter#43112 flutter/flutter#49673 flutter/flutter#49672
|
@digiter would you mind expanding on reducing the nesting scope? is it within the new function or nesting in general where the function is being used? |
|
@godofredoc one way I imagine reducing the nesting scope it to have For example this PR has: instead we could do: |
| } | ||
| }); | ||
| }); | ||
| } |
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.
@godofredoc I'm talking about reducing nesting in general, for example, this change has 6 nested scopes, which made it a little difficult to read. Also see go/tott/455.
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.
I see what you mean, thanks for the explanation. Those several layers of nested scopes are everywhere where the backend is using transactions.
Added a new bug for the cleanup as it will require to update most of the handlers:
|
@CaseyHillers thanks for the explanation added flutter/flutter#52436 for a follow up cl on cleaning up the transactional code in the backend. |
Most of the 500 errors in the backend are related to failing
transactions. This change adds retries with quadratic backoffs to remove
the flakiness.
Bugs:
flutter/flutter#42524
flutter/flutter#43112
flutter/flutter#49673
flutter/flutter#49672