-
Notifications
You must be signed in to change notification settings - Fork 865
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
Fix pgconn cancel query through the PGBouncer #1765
Conversation
This reverts commit c861bce.
Check cancellation of the request for pgbouncer
As far as I can tell, the current behavior is still within acceptable behavior for PostgreSQL. The change this reverts fails on Windows. I'm not sure exactly why. @drakkan worked on this change. Perhaps they could elaborate. But it is surprising that not reading could be a problem -- there are no bytes to read. The only reason the code originally read was to wait for the server to close the connection. |
@drakkan network seems to work differently on windows. Any ideas why? |
Hi, This change was made to fix test cases on Windows. I thought the error was related to the raw system calls used at the time, but I see this happening even now that we no longer have platform-specific code |
hi, @jackc I've added handling of of this specific error. What do you think of it? Can you please run workflow again? |
That's exactly the reason I want to revert this commit. Here's the pgbouncer log:
|
in this case I think we can just read and ignore the error but let's see what @jackc thinks I mean something like this
and always return a nil error. |
FYI here is how Postgres libpq sends cancel request: Looks like it waits for a response from a server and ignores all errors. AFAIK EINTR can be ignored by pgx since go runtime handles it. |
4fc9e7d
to
9eebd44
Compare
LGTM. |
Closes #1764