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

ExecuteInTx does not honor context cancellation #128

Open
knz opened this issue Feb 11, 2022 · 3 comments
Open

ExecuteInTx does not honor context cancellation #128

knz opened this issue Feb 11, 2022 · 3 comments

Comments

@knz
Copy link
Contributor

knz commented Feb 11, 2022

The retry loop in ExecuteInTx does not check ctx.Done to abort the retries if the context is cancelled.

Found while working on adding query cancellation in the crdb SQL shell.

cc @andreimatei @rafiss

@andreimatei
Copy link
Contributor

Don't the drivers listen for cancellation (and return a non-retryable error) - regardless of whether crdb supports cancellation or not? Do we need this library to react to cancellation?

@knz
Copy link
Contributor Author

knz commented Feb 12, 2022

The context may also have a deadline! We want that to stop the iteration too.

@andreimatei
Copy link
Contributor

Well if the driver does something for cancellation, it also does something for timeout. But the question is - do the drivers indeed care about the context? I definitely thought they did, but only for the ExecWithContext methods. We used those methods in between the retries, even if the caller's closure doesn't.

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

No branches or pull requests

2 participants