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
add libpq interface for encrypted and non-blocking cancellation #754
Merged
Conversation
This file contains 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
dlax
force-pushed
the
libpq-cancel-nonblocking
branch
7 times, most recently
from
April 2, 2024 09:02
1c0c20e
to
66d010f
Compare
dvarrazzo
reviewed
Apr 2, 2024
dlax
force-pushed
the
libpq-cancel-nonblocking
branch
from
April 2, 2024 09:47
66d010f
to
68548fd
Compare
dlax
force-pushed
the
libpq-cancel-nonblocking
branch
from
April 2, 2024 09:57
68548fd
to
18df492
Compare
dvarrazzo
requested changes
Apr 4, 2024
dvarrazzo
reviewed
Apr 5, 2024
dlax
force-pushed
the
libpq-cancel-nonblocking
branch
3 times, most recently
from
April 5, 2024 11:02
55177e5
to
621b010
Compare
Encrypted and non-blocking cancellation should be part PostgreSQL 17: - https://commitfest.postgresql.org/37/3511/ - https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=61461a300c1cb5d53955ecd792ad0ce75a104736 We here add the interface for libpq functions for this feature. An extra test is introduced, it closely reproduces src/test/modules/libpq_pipeline/libpq_pipeline::test_cancel() in PostgreSQL test suite. The error_message property of PGcancelConn is directly an str and PGcancelConn has no encoding specified and all messages come from the client (libpq).
We split the previous (misnamed) test_cancel_nonblocking() into test_cancel_conn_blocking() and test_cancel_conn_nonblocking() respectively checking PQcancelBlocking() and PQcancelStart()/PQcancelPoll(). The cancellable_query() is now responsible for creating the monitor_conn and uses a PGconn value, coming from the pgconn fixture in tests.
Similarly to PGconn, PGcancelConn must not be used after .finish(); we raise an OperationalError to prevent segfault when the connection pointer is NULL.
dvarrazzo
approved these changes
Apr 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Rebasing and merging, thank you very much!
dvarrazzo
force-pushed
the
libpq-cancel-nonblocking
branch
from
April 5, 2024 18:35
621b010
to
4563c5d
Compare
Merged now 🙂 |
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.
First step for #534