You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While investigating #12189, found that the new Go 1.5 implementation of LookupAddr always calls cgo first, even when the DNS configuration on the machine does not merit it, and even when GODEBUG=netdns=go is set in the environment. (If the tree was built with CGO_ENABLED=0 ./make.bash then the cgo call fails quickly and the code falls back to the pure Go version. But it is still called.)
Previous releases of Go had no cgo implementation of LookupAddr, so they always used the pure Go version.
Using cgo unconditionally means that a thread is held by a blocked call (except when CGO_ENABLED=0 of course), where in previous releases it was only a goroutine being held. This is a significant resource increase.
It's even worse that setting GODEBUG, which is supposed to keep cgo from being used, does nothing in this case.
LookupAddr should respect GODEBUG and even without GODEBUG it should not use cgo if the resolver config can be handled by pure Go.
The text was updated successfully, but these errors were encountered:
Thanks for the investigation and sorry to trouble you. The change looks good to me even though it appends a trailing dot unconditionally when GODEBUG=netdns=cgo and the name is stored in local database such as /etc/hosts. I now think it's fine because /etc/hosts could be considered as a substitute for some DNS RRs; A, AAAA, PTR (and CNAME on some platform), and actually mDNS speaker implementations use it as a source of RRs.
While investigating #12189, found that the new Go 1.5 implementation of LookupAddr always calls cgo first, even when the DNS configuration on the machine does not merit it, and even when GODEBUG=netdns=go is set in the environment. (If the tree was built with CGO_ENABLED=0 ./make.bash then the cgo call fails quickly and the code falls back to the pure Go version. But it is still called.)
Previous releases of Go had no cgo implementation of LookupAddr, so they always used the pure Go version.
Using cgo unconditionally means that a thread is held by a blocked call (except when CGO_ENABLED=0 of course), where in previous releases it was only a goroutine being held. This is a significant resource increase.
It's even worse that setting GODEBUG, which is supposed to keep cgo from being used, does nothing in this case.
LookupAddr should respect GODEBUG and even without GODEBUG it should not use cgo if the resolver config can be handled by pure Go.
The text was updated successfully, but these errors were encountered: