Repository navigation
Release 0.5.5: send the CancelRequest before closing the socket - #6
Merged
Merged
Conversation
A statement given up on, by a timeout, a cancellation or a raise from the caller's callback, was cancelled at the server only after the connection's socket had closed. A pooling proxy finds the session a cancel names by its client, and drops one for a client that has already disconnected, so the statement ran on for nobody. The socket now closes only once the cancel is done. The connection is still detached first, its unsent statements refused as closed: were it to take statements while the cancel is on its way, one could run at the server, be cancelled in the given-up one's place, or answer as lost where nothing was meant to be sent.
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.
Why
A statement given up on, by a timeout, a cancellation or a raise from the caller's callback, was cancelled at the server only after the connection's socket had closed. A pooling proxy finds the session a cancel names by its client, and drops one for a client that has already disconnected, so the statement ran on for nobody. This carries on #2 by @Sanguinor88, whose commit it keeps as author: the socket now closes only once the cancel is done. Keeping the connection open meanwhile would let it take statements while the cancel is on its way, and one could run at the server, be cancelled in the given-up one's place, or answer as lost where nothing was meant to be sent, so the connection is detached first.
Changes
make setupmakes,postgres-eio, as the Makefile does.Verified
54.2.8 nothing is sent while a cancel is on its wayfailed on Send the CancelRequest before closing the socket #2 as it stood (the statement was taken) and passes now;54.2.8 a cancel is sent before the connection closespasses.make test: 366 tests pass against the test Postgres;make lint: no findings;make docsregeneratedagents/.