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, Oct 3, 12:41 PM
Unknown Object (File)
Sat, Oct 3, 10:48 AM
Unknown Object (File)
Fri, Oct 2, 9:25 PM
Unknown Object (File)
Fri, Oct 2, 8:25 PM
Unknown Object (File)
Thu, Oct 1, 4:59 AM
Unknown Object (File)
Sun, Sep 27, 11:15 AM
Unknown Object (File)
Thu, Sep 17, 7:19 AM
Unknown Object (File)
Wed, Sep 9, 4:20 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 67166
Build 64049: arc lint + arc unit

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.