Repository navigation
Handle when IO operations are cancelled - fix #1212 - #1292
Open
andrewjw1995 wants to merge 1 commit into
Open
andrewjw1995 wants to merge 1 commit into
andrewjw1995 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1212. Some async operations accept a cancellation token and pass it through to the IO operations they perform. If the IO operations are cancelled then we may end up in one of the following states:
This can be demonstrated by opening a connection, beginning a transaction, and cancelling the request immediately, which has been added as a test case.
I couldn't see an easy way to ignore frames that were interrupted or don't align to the current request/response, so when an IO operation is cancelled I have opted to treat it the same as an IO exception. The connection is marked as broken and removed from the connection pool.
TODO: I haven't checked this for compatibility with all the supported build configurations and Firebird versions. I'm hoping this is covered by the build pipeline, otherwise I will need some guidance on this.
AI usage
As per the contributor guidelines, this code was implemented by Cursor. I have reviewed it to make sure I fully understand the problem and approve of the solution that was implemented.