Page MenuHomeFreeBSD

rc.subr: Move the sleep in wait_for_pids
ClosedPublic

Authored by des on Sep 19 2025, 2:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 1, 6:35 PM
Unknown Object (File)
Tue, Oct 21, 3:28 AM
Unknown Object (File)
Thu, Oct 16, 5:21 AM
Unknown Object (File)
Oct 12 2025, 6:15 PM
Unknown Object (File)
Oct 10 2025, 4:00 PM
Unknown Object (File)
Oct 10 2025, 9:58 AM
Unknown Object (File)
Oct 10 2025, 9:58 AM
Unknown Object (File)
Oct 10 2025, 6:16 AM
Subscribers

Details

Summary

Instead of sleeping while constructing the list of PIDs to wait for,
sleep briefly after pwait to give init a chance to reap the processes
that just terminated before we loop around and start probing them.

PR: 289630

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Sep 19 2025, 2:18 PM

Why did we sleep in the for loop in the first place before?

In D52619#1203159, @0mp wrote:

Why did we sleep in the for loop in the first place before?

I believe the intent was the same, it was just poorly implemented, and probably never thoroughly tested with more than one PID. I added automated tests, which are now failing intermittently because once in a great while, after pwait returns, we manage to kill -0 the process that just terminated before init gets around to collecting it.

This revision is now accepted and ready to land.Sep 23 2025, 12:51 PM
This revision was automatically updated to reflect the committed changes.