Skip to content
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

add exponential retry if TxnConflictException occures #217

Closed
wants to merge 1 commit into from

Conversation

shivaji-kharse
Copy link
Contributor

No description provided.

@shivaji-kharse shivaji-kharse requested a review from a team as a code owner July 23, 2024 11:27
@shivaji-kharse shivaji-kharse force-pushed the shiva/retry branch 2 times, most recently from b7bc6bf to 750d7be Compare July 24, 2024 10:01
Copy link
Contributor

@rarvikar rarvikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, we could allow users to choose whether to retry a transaction by introducing a new boolean parameter for retries in the "doRequest" method.

if (code.equals(Status.Code.ABORTED)
|| code.equals(Status.Code.FAILED_PRECONDITION)) {
throw new CompletionException(new TxnConflictException(desc));
return executeWithExponentialBackoff(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide the user the option to retry the transaction rather than forcing one. In some use-cases like BnF, it may not be desirable to retry all transactions that failed due to a conflict.

Copy link

This PR has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

@github-actions github-actions bot added the Stale label Sep 24, 2024
@github-actions github-actions bot closed this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants