PVF: ensure job processes are cleaned up, add tests (#2643)

Fixes a potential memory leak.

`PR_SET_PDEATHSIG` is used to terminate children when the parent dies.
Note that this is subject to a race. There seems to be a raceless
alternative [here](https://stackoverflow.com/a/42498370/6085242), but
the concern is small enough that a bit more complexity doesn't seem
worth it. Left a bit more info in the code comment.
This commit is contained in:
Marcin S
2023-12-29 16:27:18 +01:00
committed by GitHub
parent 45f4d9a2b9
commit 8bf5a1c0b3
5 changed files with 101 additions and 80 deletions
@@ -96,4 +96,6 @@ pub enum JobError {
CouldNotSpawnThread(String),
#[error("An error occurred in the CPU time monitor thread: {0}")]
CpuTimeMonitorThread(String),
#[error("Could not set pdeathsig: {0}")]
CouldNotSetPdeathsig(String),
}