Merge fix/review-2026-12-phase2 (2026-12-02 review fix plan)

This commit is contained in:
Joseph Doherty
2026-12-03 10:18:43 -05:00
44 changed files with 2264 additions and 123 deletions
+11 -3
View File
@@ -1053,9 +1053,17 @@ Policy:
- stuck workers are killed by process id,
- gateway restart does not reattach old workers; `OrphanWorkerCleanupHostedService`
runs `OrphanWorkerTerminator` once on startup — before the server accepts
sessions — to kill leftover `ZB.MOM.WW.MxGateway.Worker.exe` processes (matched by the
configured worker executable path, or by image name when the x64 gateway cannot
introspect the x86 worker's module) left behind by a previous unclean run.
sessions — to kill leftover `ZB.MOM.WW.MxGateway.Worker.exe` processes left behind by
a previous unclean run. A candidate must match the configured worker executable path
(when its path is readable), and its command line's `--pipe-name`
(`mxgw-{gatewayPid}-{sessionUid}`) must name a gateway process that is no longer running
(or whose id was recycled: it started after the worker). A worker of a gateway that is
still running — a second gateway from the same build output, a test host — is left
alone. When neither the path nor the command line can be read, the process is left
alone and logged, since an image-name match alone could be another build's worker; when
the path matches but the command line cannot be read, the path decides, as before. The
command line is read with `NtQueryInformationProcess(ProcessCommandLineInformation)`,
which works from the x64 gateway on the x86 worker.
Because each client owns one worker, a crash or leak affects only that session.