HomeClusterLabs Projects

Fix bug in handling of child process exit.

Description

Fix bug in handling of child process exit.

When storage_mon detects that a child process exits with zero,
it resets the test_forks[] entry for the child process to 0, to avoid
waitpid() for the process again in the loop. But, previously,
storage_mon didn't do that when it detected that a child process
exited with non-zero. Which caused waitpid() to be called again
for the process already gone and to report an error like
"waitpid on XXX failed: No child processes" unexpectedly.
In this case, basically storage_mon should wait until all the child
processes exit and return the final score, instead.

This patch fixes this issue by making storage_mon reset test_works[]
entry even when a child process exits with non-zero.

Details

Provenance
Fujii Masao <fujii@postgresql.org>Authored on Jul 19 2022, 9:34 AM
Parents
rRf021a7f731a5: storage_mon: make -h exit just after printing help message (#1791)
Branches
Unknown
Tags
Unknown

Event Timeline

Fujii Masao <fujii@postgresql.org> committed rRc6ea93fcb499: Fix bug in handling of child process exit. (authored by Fujii Masao <fujii@postgresql.org>).Jul 19 2022, 9:34 AM