Comment by ninkendo
3 years ago
It also doesn’t play well with split tunnel VPN’s on macOS that are configured for particular DNS suffixes. If you have a VPN that is only active for connections in a particular domain, git-lfs (and I think any go software, by default) will try to use your non-VPN connection for connections that should be on the VPN.
I don’t know why it is, exactly… but I think it’s related to Golang intentionally avoiding using the system libc and implementing its own low-level TCP/IP functions, leading to it not using the system configuration which tells it which interface to use for which connections.
Edit: now that I think about it, I think the issue is with DNS… macOS can be configured such that some subdomains (like on a VPN) are resolved with different DNS servers than others, which helps isolate things so that you only use your VPN’s DNS server for connections that actually need it. Go’s DNS resolution ignores this configuration system and just uses the same server for all DNS resolution, hence the issue.
Go’s choice to default to its own TCP/IP implementation has bitten me personally to the level of requiring a machine restart.
The Go IPv6 DNS resolution on MacOS can cause all DNS requests on the system to begin to fail until a restart.
https://github.com/golang/go/issues/52839
Not to understate the impact of the bug, but this is not the default for Go. It is used if CGo is disabled, as the issue you linked to describes.
That is the default for Go if cross-compiled, however, and most software compiled on a CI server is cross-compiled to Darwin.
Fortunately Go 1.20 fixes this, using the system resolved even without CGo on Darwin platforms [1].
[1]: https://go-review.googlesource.com/c/go/+/446178
The OS network stack is crashing and this is Go's fault? Is Go holding the network stack wrong?
To be fair, "getaddrinfo is _the_ path" is a shitty situation.
- It's a synchronous interface. Things like getaddrinfo_a are barely better. It has forced people to do stuff like https://c-ares.org/ for ages, which has suffered from "is not _the_ path" issues for as long
- It's a less featured interface than, for example, https://wiki.freedesktop.org/www/Software/systemd/writing-re...