Skip to content

Use Windows job to improve process termination

Matthew Bradburn requested to merge mbradburn-use-windows-job-object into main

What does this MR do?

It adds a new feature flag, FF_USE_WINDOWS_JOB_OBJECT, which when set causes the runner to create a windows job object, and add newly-created processes to the job. Sub-processes are automatically added to the job by the OS, recursively. If the build is canceled or times out, we can close the job object to terminate all processes in the job.

Why was this MR needed?

Certain processes are not terminated effectively by the current system; we're currently sending console events but using the customer's repro scenario from the issue (with ping) they don't always get received.

What's the best way to test this MR?

Hopefully similar to the way I tested it; I set up a job with the 'ping' scenario, verified that setting the feature flag allows the ping process to be killed. The behavior is unchanged when the feature flag is not set.

What are the relevant issue numbers?

#3121 (closed)

Edited by Matthew Bradburn

Merge request reports