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
{{ message }}
Repository navigation
lib_rtnl.c: uc_nl_request - if the socket assigned to 'sock' fails in some way there is no way to close and reopen it #422
We see an occasional problem during our boot process where a daemon, which is using the uc_nl_request call in lib_rtnl.c, fails to get a valid reply - in our case we are reading an interface list. We think that the socket is opened correctly (~line 3477) but then fails. However, once in this failed state there is no way to reopen it as it is cached internally and will continue to fail. The only fix we've found is to restart our daemon.
We'd be happy to write a PR but are not sure what solution you'd prefer? We could do away with the socket cache entirely, or we could try to close it on any error.
changed the title [-]lib_rtnl.c: uc_nl_request - it the socket assigned to 'sock' fails in some way there is no way to close and reopen it[/-][+]lib_rtnl.c: uc_nl_request - if the socket assigned to 'sock' fails in some way there is no way to close and reopen it[/+]on Aug 3, 2026
Any chance to capture an strace once in the broken state? Like letting the daemon continuously try to fetch the interface list, then - in failing state - strace -p to it and see how the requests fail (socket level error or socket connected but not subscribed, ...).
Not opposed to some sort of socket reconnect API either but I'd like to avoid just papering over an actual problem. At the very least I'd like to get the success state logic right to avoid caching a half-open broken socket connection.
I believe this is the snippet that's relevant (I can post more of course, but wanted to save you the trouble of wading though a lot of unimportant stuff):
Activity
[-]lib_rtnl.c: uc_nl_request - it the socket assigned to 'sock' fails in some way there is no way to close and reopen it[/-][+]lib_rtnl.c: uc_nl_request - if the socket assigned to 'sock' fails in some way there is no way to close and reopen it[/+]jow- commentedon Aug 3, 2026
Any chance to capture an strace once in the broken state? Like letting the daemon continuously try to fetch the interface list, then - in failing state -
strace -pto it and see how the requests fail (socket level error or socket connected but not subscribed, ...).Not opposed to some sort of socket reconnect API either but I'd like to avoid just papering over an actual problem. At the very least I'd like to get the success state logic right to avoid caching a half-open broken socket connection.
aanon4 commentedon Aug 3, 2026
I believe this is the snippet that's relevant (I can post more of course, but wanted to save you the trouble of wading though a lot of unimportant stuff):
I haven't tried to understand this, but I did see EBUSY showing up a couple of times in this trace.
aanon4 commentedon Aug 3, 2026
I should add that the trace information immediately before and after the above looks entirely related to my application and not lib_rtnl.c
aanon4 commentedon Aug 5, 2026
And another small piece of information. In longer testing we sometimes see these calls fail after working correctly for some time.
aanon4 commentedon Aug 29, 2026
For the moment we're just closing the connection after use so we get a new 'sock' each time.
ptpt52 commentedon Oct 8, 2026
@aanon4
try #474
rtnl: reset and close request socket on error and export rtnl.close()