Page MenuHomeFreeBSD

rc.subr: Move the sleep in wait_for_pids
ClosedPublic

Authored by des on Fri, Sep 19, 2:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 6:15 PM
Unknown Object (File)
Fri, Oct 10, 4:00 PM
Unknown Object (File)
Fri, Oct 10, 9:58 AM
Unknown Object (File)
Fri, Oct 10, 9:58 AM
Unknown Object (File)
Fri, Oct 10, 6:16 AM
Unknown Object (File)
Fri, Oct 10, 3:32 AM
Unknown Object (File)
Wed, Oct 8, 12:07 PM
Unknown Object (File)
Thu, Oct 2, 5:12 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.Fri, Sep 19, 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.Tue, Sep 23, 12:51 PM
This revision was automatically updated to reflect the committed changes.