Add transaction retries.#683
Add transaction retries.#683godofredoc merged 2 commits intoflutter:masterfrom godofredoc:fix_backend_errors
Conversation
CaseyHillers
left a comment
There was a problem hiding this comment.
LGTM with nit! This is a great utility function to have available in the backend.
There was a problem hiding this comment.
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.
Done, added them as optional parameters.
digiter
left a comment
There was a problem hiding this comment.
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.
@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.
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