Page MenuHomeFreeBSD

pwait: Test the new -r option
ClosedPublic

Authored by des on Tue, Jul 21, 8:08 PM.
Tags
None
Referenced Files
F164631957: D58385.id182621.diff
Sun, Aug 2, 5:23 PM
Unknown Object (File)
Sun, Aug 2, 6:31 AM
Unknown Object (File)
Sun, Aug 2, 5:48 AM
Unknown Object (File)
Sun, Aug 2, 4:53 AM
Unknown Object (File)
Sun, Aug 2, 4:21 AM
Unknown Object (File)
Sat, Aug 1, 9:09 AM
Unknown Object (File)
Sat, Aug 1, 6:28 AM
Unknown Object (File)
Fri, Jul 31, 10:25 PM
Subscribers

Details

Summary

Test that pwait without -r reports a process as soon as it terminates,
while pwait with -r does not report it until it has been reaped.

MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.

Diff Detail

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

Event Timeline

des requested review of this revision.Tue, Jul 21, 8:08 PM
des retitled this revision from pwait: Test that pwait does not report zombies to pwait: Test the new -r option.Wed, Jul 22, 8:16 AM
des edited the summary of this revision. (Show Details)
des edited the summary of this revision. (Show Details)

new behavior is now optional, test both variants

bin/pwait/tests/pwait_reap.c
126

Why not using posix_spawn() there?

136

You are not waiting for the termination there, wait_zero(false) only checks for termination and asserts if not. As the consequence, the test is racy, since nothing guarantees that the target has exited when waitpid() is called.

bin/pwait/tests/pwait_reap.c
126

What would be the advantage?

136

I think you're confusing WNOWAIT with WNOHANG.

bin/pwait/tests/pwait_reap.c
126

That the used API is specifically designed for the task at hand.

136

No, I do not. Re-read what I wrote: wait_zero(false) may assert falsely.

bin/pwait/tests/pwait_reap.c
136

No. It will block until the target terminates. It will fail if interrupted, but I don't consider that a problem.

This revision is now accepted and ready to land.Fri, Jul 24, 10:02 PM
This revision was automatically updated to reflect the committed changes.
bin/pwait/tests/pwait_reap.c
169

Shouldn't this be pwait_reap_test(false)?

bin/pwait/tests/pwait_reap.c
169

You're right, will fix.