Skip to content

Don't orphan the monitoring subprocess if parent process is killed

Jeremiah Bonney requested to merge jbonney/cleanup-termination into master

Description

The monitoring bus runs in a separate process, which communicates via the parent process using a queue to get metric/log events to publish. If the parent process, BuildGrid, is terminated unexpectedly due to the OOM killer or similar this subprocess gets orphaned and continues running. This PR updates the logic around determining whether the monitoring subprocess should exit to verify that the parent process is still around, and exit if not.

Validation

  1. Start up BuildGrid with monitoring enabled
  2. Get the PID of BuildGrid and send it a SIGKILL
  3. Before this PR the monitoring subprocess will continue running, after this PR it will exit as expected.

Merge request reports