-
Notifications
You must be signed in to change notification settings - Fork 928
Add transaction retries #2250
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
Merged
Merged
Add transaction retries #2250
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
48642ad
Add runTransaction parameter
schmidt-sebastian e4cdfe0
Add transaction retries
schmidt-sebastian d3669b6
Unit test fix
schmidt-sebastian 10c2f8e
[AUTOMATED]: Prettier Code Styling
schmidt-sebastian a1e5a00
First round of feedback
schmidt-sebastian aee20aa
Lint
schmidt-sebastian bde88fb
Update test name
schmidt-sebastian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This function isn't actually idempotent and I can't see from reading this why this would actually fail and trigger multiple attempts. Could you add some comments describing your intent here?
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 made the failure more obvious by adding a comment pointing out exactly where it would fail.
As for the idempotency: I think it will be mighty hard to write a unit test for an actually idempotent function that fails on the first attempt but succeeds thereafter. I hope that the intent of the code speaks for itself.
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.
Sorry I wasn't clear--I don't think the function should be idempotent because I agree that writing a test that succeeds while using one would be hard.
I was trying to say that "retries idempotent transactions" seemed misleading. Also that I couldn't understand how the thing failed, and the test name didn't help me understand that.
You might consider renaming the test to "retries readwrite-idempotent transactions" to emphasize that it's the mode flag that's idempotent and not the function implementing it.
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.
Got it. I renamed the test to 'retries transactions marked as idempotent' (since 'readwrite-idempotent' is hopefully short lived).