Page MenuHomeFreeBSD

Fix hung TCP sessions on shutdown
AbandonedPublic

Authored by jtl on Dec 3 2020, 7:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2024, 10:35 PM
Unknown Object (File)
Jan 30 2024, 2:48 AM
Unknown Object (File)
Jan 11 2024, 10:56 PM
Unknown Object (File)
Jan 11 2024, 5:57 AM
Unknown Object (File)
Dec 23 2023, 1:24 AM
Unknown Object (File)
Aug 9 2023, 6:52 AM
Unknown Object (File)
Jul 23 2023, 7:31 PM
Unknown Object (File)
Jul 10 2023, 4:19 AM
Subscribers

Details

Reviewers
cy
markj
rrs
tuexen
Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No 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.