Jenkins seems to kill the top level script with a -9 argument as all it's subprocesses get orphaned.
If we fork a script with the PID of the parent. It can recursively kill all subprocesses of the original parent if the original parent goes away.
Probably polling ps and keeping track of subprocesses in the background then killing if the parent goes away. Checking the PID hasn't been reallocated.
This will become critical if we add timeouts, especially for the doc jobs.
Jenkins seems to kill the top level script with a -9 argument as all it's subprocesses get orphaned.
If we fork a script with the PID of the parent. It can recursively kill all subprocesses of the original parent if the original parent goes away.
Probably polling ps and keeping track of subprocesses in the background then killing if the parent goes away. Checking the PID hasn't been reallocated.
This will become critical if we add timeouts, especially for the doc jobs.