[Commander]: Fix process handle leak when using Windows Jobs

What does this MR do?

Fixes a leak of a process handle for each created process from the runner, when using the Windows Job feature flag - `FF_USE_WINDOWS_JOB_OBJECT`

Why was this MR needed?

Leaking handles is bad, they accumulate over time.

What's the best way to test this MR?

I have manually tested a before and after with Sysinternals/ProcExp - leaking Process handles before: (About 4 on each job run)

ProcExp-LeakingHandles

And now not leaking handles at all.

I don't think we want a regression system test for this fix.

What are the relevant issue numbers?

#39289 (closed)

Additional notes

Go v1.26 adds Process.WithHandle which could be used here, but didn't want to go into the version bump journey myself

Edited by Ilan Godik

Merge request reports

Loading