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

Support automatic deadlock retry #47

Open
ejball opened this issue Oct 20, 2021 · 2 comments
Open

Support automatic deadlock retry #47

ejball opened this issue Oct 20, 2021 · 2 comments

Comments

@ejball
Copy link
Member

ejball commented Oct 20, 2021

A RetryDbConnector could retry operations on transient and/or deadlock exceptions.

This would work well with ExecuteTransaction (#46) but not with BeginTransaction etc. Should RetryDbConnector.BeginTransaction throw?

The settings should integrate well with Polly, ideally without taking a dependency on it.

Expose a Retry(Async) method that allows the caller to create their own retry units?

We would probably need protected overrides on DbConnector to which command operations would delegate so that we can retry queries.

@ejball
Copy link
Member Author

ejball commented Oct 20, 2021

Retrying deadlocks can be done with the same IDbConnection, but retrying other transient errors necessitates a new IDbConnection, which is not something safely done automatically for anything but the first command, since there may be session state that needs to be retained.

@ejball ejball changed the title Support automatic retry Support automatic deadlock retry Oct 21, 2021
@ejball
Copy link
Member Author

ejball commented Oct 21, 2021

Reducing the scope of this issue to retrying deadlocks. RetryDeadlockDbConnector (or RetryTransactionDbConnector?) might be a better name. Throwing on BeginTransaction would create a pit of success. Needs #46.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant