Log server error when issuing auth query#1187
Merged
JelteF merged 7 commits intopgbouncer:masterfrom Dec 2, 2024
Merged
Conversation
JelteF
approved these changes
Dec 2, 2024
Member
JelteF
left a comment
There was a problem hiding this comment.
Thanks for this change, it looks good but needs a small rebase.
Contributor
Author
|
@JelteF Thanks for the review. The windows error looks to be something affecting all the recent PRs and unrelated to this change. It might be related to the image used. I could probably spare some time to see if I can fix this in a separate PR. |
Member
|
If you have time to fix the Windows build in another PR that would be greatly appreciated. |
rajaryanece
pushed a commit
to rajaryanece/pgbouncer
that referenced
this pull request
Jan 16, 2025
This is inspired by what happens here: https://github.com/pgbouncer/pgbouncer/blob/master/src/server.c#L151. When receiving an error packet they call `log_server_error` before `disconnect_server` and the former's note has `S:` prepended to it. I am guessing that is to distinguish it as a note coming from the server rather than something generated from pgbouncer. Fixes pgbouncer#954
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.
Closes #954
This is my attempt to log the error message from auth queries coming from Postgres.
I tried to follow what happens here: https://github.com/pgbouncer/pgbouncer/blob/master/src/server.c#L151. When receiving an error packet they call
log_server_errorbeforedisconnect_serverand the former's note hasS:prepended to it. I am guessing that is to distinguish it as a note coming from the server rather than something generated from pgbouncer.