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

Throw CommandTimeoutExpired exception when query is cancelled #939

Closed
bgrainger opened this issue Feb 6, 2021 · 1 comment
Closed

Throw CommandTimeoutExpired exception when query is cancelled #939

bgrainger opened this issue Feb 6, 2021 · 1 comment

Comments

@bgrainger
Copy link
Member

Command timeouts are now implemented by first attempting to cancel the query server-side. If this succeeds, a MySqlException will be thrown with the code QueryInterrupted.

This proposes that the error code be changed to CommandTimeoutExpired, so it's uniform for whether soft- or hard-cancellation happens for a command timeout, and QueryInterrupted is used only for MySqlCommand.Cancel. This reverts the decision in #455 (comment):

If the server-side cancellation is successful, the Execute/Read/etc. method will throw a MySqlException with an ErrorCode set to MySqlErrorCode.QueryInterrupted. This is a change from current behaviour, which throws a MySqlException with MySqlErrorCode.CommandTimeoutExpired.

This change will restore the behaviour to how it was prior to 1.1.0. For clients that need to distinguish server-side vs client-side command timeout, an InnerException could hold the QueryInterrupted error code.

This issue was closed.
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