Page MenuHomeFreeBSD

Fix hung TCP sessions on shutdown

Authored by jtl on Dec 3 2020, 7:49 PM.



After r366857, TCP sessions are hanging on shutdown. This occurs when the shutdown script shuts down the network interfaces before init kills off remaining processes with open TCP connections. (For example, incoming SSH sessions are not killed off until after init is finished running the shutdown scripts.)

This change will kill off all TCP connections only when the script is shutting down all network interfaces. When a user is shutting down only some network interfaces, it is non-trivial to determine which TCP connections may be impacted.

Diff Detail

rS FreeBSD src repository - subversion
Lint OK
No Unit Test Coverage
Build Status
Buildable 35173
Build 32123: arc lint + arc unit

Event Timeline

jtl requested review of this revision.Dec 3 2020, 7:49 PM

Not exactly the best, but I think it fixes the immediate problem. From a long term perspective we may want to
look for a better solution :)

This revision is now accepted and ready to land.Dec 3 2020, 8:03 PM

It fixes the issue. For SCTP we would need something like sctpdrop. I can try to add that...

I just saw the discussion on the committers mailing list. First, it shows that @cy already has a proposed fix. Secondly, it shows that this is a larger issue (for example, netboot), which probably needs a different solution.