-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
pgwire cannot bind to IPV4 "all-addresses" #3962
Comments
cc @mberhault |
Ok after some more investigation this issue is not reallyn related to the argument |
Found while investigating #4036 |
https://groups.google.com/forum/#!msg/golang-nuts/F5HE7Eqb6iM/q_um2VqT5vAJ has some good info on this. |
@knz can you replicate this on a Mac? I dived in a bit and it seems like Go thinks it's a ipv4 address. Linux may be doing some auto ipv6 magic. |
I'm not sure exactly how the system calls are exposed via go, but I've run into this in the past. In short, linux likes to bind to both ipv4 and ipv6 together whenever it can, while BSD and OSX require them to be bound separately. To handle things in a sane and cross-platform way you have to pass extra socket options on linux to make it act more like BSD. This seems like something Go should handle for us instead of something we do at our level. |
The issue was found and was affecting a Linux system. |
This was (unintentionally) fixes in #4161. |
Without any arguments, pgwire listens only on [::]:15432 (ipv6 all-addresses).
With
--pgaddr 0.0.0.0:15432
(ipv4 all-ddresses), the configuration is ignored and it starts listening on [::]:15432 as well.Only with an explicit ipv4 address (eg.
--pgaddr x.y.z.w:15432
) does the desired behavior appear.I think this is rather new as I did not have this problem last week.
There are two bugs in here:
--pgaddr 0.0.0.0:15432
should really listen on ipv4The text was updated successfully, but these errors were encountered: