Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Break the connection when sync cancellation fails #3187

@roji

Description

@roji

With our new cancellation logic, when the user triggers a cancellation token (or CommandTimeout is reached), we attempt a PG cancellation. In async, if the PG cancellation itself fails (e.g. failure to connect because of a network partition), we immediately break the (main command's) connection.

We should look into doing the same for sync cancellation. We can't trigger a cancellation token, but IIRC it's OK to forcibly close the socket - this should immediately terminate any I/O operation stuck on that socket. This of course needs testing - and I'm not sure which exception gets thrown on the read side - but it would align sync and async behavior and is generally useful.

/cc @vonzshik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions