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
F164936949: D52619.diff
Wed, Aug 5, 12:03 AM
F164872344: D52619.diff
Tue, Aug 4, 9:46 AM
Unknown Object (File)
Tue, Jul 28, 7:13 AM
Unknown Object (File)
Mon, Jul 27, 1:49 AM
Unknown Object (File)
Fri, Jul 24, 7:52 PM
Unknown Object (File)
Tue, Jul 21, 5:57 PM
Unknown Object (File)
Sun, Jul 19, 11:13 AM
Unknown Object (File)
Sat, Jul 18, 12:27 PM
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.