GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Handle when IO operations are cancelled - fix #1212 by andrewjw1995 · Pull Request #1292 · FirebirdSQL/NETProvider

Conversation

@andrewjw1995

@andrewjw1995 andrewjw1995 commented Nov 2, 2026

Copy link
Copy Markdown

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:

  • The request was not fully written to the stream
    • If we perform another operation on the stream, the request will not be interpreted correctly by the database
  • We have a complete response waiting to be read from the underlying stream
    • If we perform another operation on the stream, the responses will be out of alignment
  • The response was not fully read from the stream
    • If we perform another operation on the stream, the response will not be interpreted correctly by the client

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andrew-williamson-hill-labs
Handle when IO operations are cancelled
55a2b22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Exception in ParseTruncSqlInfo or ParseTruncSqlInfoAsync

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@andrewjw1995 @andrew-williamson-hill-labs
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.