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

InvalidOperationException thrown from Cancel #386

Closed
bgrainger opened this issue Oct 31, 2017 · 2 comments
Closed

InvalidOperationException thrown from Cancel #386

bgrainger opened this issue Oct 31, 2017 · 2 comments
Assignees
Labels

Comments

@bgrainger
Copy link
Member

System.InvalidOperationException: Expected state to be (Querying|CancelingQuery) but was Failed.
   at MySql.Data.Serialization.MySqlSession.VerifyState(State state1, State state2)
   at MySql.Data.Serialization.MySqlSession.TryStartCancel(MySqlCommand command)
   at MySql.Data.MySqlClient.MySqlConnection.Cancel(MySqlCommand command)
   at Dapper.SqlMapper.GridReader.Dispose()
   at [Class].<MethodAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---

It's possible that the command is timing out (and killing the connection). If so, Cancel should be a no-op.

@bgrainger bgrainger added the bug label Oct 31, 2017
@bgrainger bgrainger self-assigned this Oct 31, 2017
@bgrainger
Copy link
Member Author

Couldn't create a test to reproduce it, but fixed the logic error that allowed this to happen.

@bgrainger
Copy link
Member Author

Fixed in 0.31.0.

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

No branches or pull requests

1 participant