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)
Wed, Mar 4, 8:40 AM
Unknown Object (File)
Sun, Mar 1, 11:39 PM
Unknown Object (File)
Sun, Mar 1, 11:37 AM
Unknown Object (File)
Sun, Mar 1, 8:49 AM
Unknown Object (File)
Sun, Mar 1, 2:52 AM
Unknown Object (File)
Thu, Feb 26, 9:07 AM
Unknown Object (File)
Sun, Feb 22, 7:08 PM
Unknown Object (File)
Mon, Feb 16, 9:03 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.