Improve warning when connection to unix socket fails#837
Conversation
f7c7fa1 to
2fcf827
Compare
|
Why don't you provide messages for IPv4 and IPv6? AFAICS, this |
|
I wasn't able to trigger the WARNING for IPv4/IPv6 sockets. They would error during reading instead of erroring at connect. Those errors during reading would become a LOG with the log_socket_prefix. So those are already pretty helpful. |
|
I didn't try to reproduce it but the following code can trigger it. Looking at |
2fcf827 to
67b0983
Compare
|
Thanks for the pointer. By manually setting my file limit very low I was able to trigger the WARNING for IPv4/IPv6 sockets too. So now the patch includes a better error for those as well. |
|
Since sa2str encapsulates the print-a-network-address logic, you don't need the if/else. Use only the last else statements. |
PgBouncer is hard to debug when it's trying to connect to Postgres server over a UNIX socket but that connection fails. You would get an unhelpful error message like this: ``` WARNING sbuf_connect failed: No such file or directory ``` This change starts including the path in the error message: ``` WARNING sbuf_connect failed to connect to UNIX socket /aaaaa/.s.PGSQL.5432: No such file or directory ``` It also includes the address+port for IPv4/IPv6 connection attempts.
67b0983 to
05dd56f
Compare
|
Makes total sense. Pushed that now. I had a bit of a brainfart I think because I misremembered the fix for this issue: libusual/libusual@9469419 |
PgBouncer is hard to debug when it's trying to connect to Postgres
server over a UNIX socket but that connection fails. You would get an
unhelpful error message like this:
This change starts including the path in the error message:
It also includes the address+port for IPv4/IPv6 connection attempts.
Fixes #835