syscall: NetlinkRIB's Recvfrom hangs #69797
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.22.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
We have this custom-made exporter that periodically tries to get the IP addresses of interfaces in different network namespaces.
Basically it:
What did you see happen?
In some (very) rare cases, the call to net.(*Interface).Addrs hangs, until I either kill the process, or dlv attach it, at which point the syscall is interrupted.
I collected a stack trace from the blocked goroutine, of which here's a partial extract:
Recvfrom on the netlink socket opened by syscall.NetlinkRIB seems to be the culprit here.
I have also collected a dump from NetlinkRIB's
tab
byte array. It contains a fewsyscall.RTM_NEWADDR
messages but of course, nosyscall.NLMSG_DONE
.What did you expect to see?
The call to iface.Addrs() should not hang.
Although I have no idea why it hangs, I've found issues here and there on different projects that look similar:
I'm no netlink specialist. Does anyone know if the kernel stopping talking to us over the netlink socket is something that can happen? Should we make that socket non-blocking?
The text was updated successfully, but these errors were encountered: