[pbs-devel] [PATCH proxmox] daemon: clean up middle process of double fork
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Dec 3 10:29:34 CET 2024
Am 03.12.24 um 10:14 schrieb Dominik Csapak:
> my fear was that if there's something wrong with the middle child (e.g. something hangs)
> we'll never close the parent process either and have two old processes hanging around instead of one.
FWIW: You could still add a generous timeout. IMO it's less likely that we
hang here if the fork of the actual re-exec-self process worked, as then
the middle one just needs to exit, compared to the middle child not being
scheduling for a while after the work and before it exits, which is still
unlikely, but less so.
The old process being left-over itself was not a problem per se after all.
If you really fear something can hang then it would be much better to use
a timeout here and log an error, as that way it would be even more likely
to notice such bugs which a single probe using WNOHANG will always mask.
More information about the pbs-devel
mailing list