fix(workers): capture worker stderr/stdout, forward it to the gateway log, and attach the stderr tail to early-exit StartupFailed (WRK-002, #259)
ci / windows-x86 (push) Successful in 3m50s
ci / java (push) Failing after 10m14s
ci / portable (push) Failing after 19m55s

The worker was started with CreateNoWindow and no redirection, so its log lines
went to a hidden console of its own and were lost under both a console run and
the NSSM service (verified on windev). The launcher now redirects both streams
and WorkerOutputCapture drains them: each line is forwarded under the
ZB.MOM.WW.MxGateway.Worker category at the worker's own level, the session
nonce is scrubbed, and the last 50 lines / 4 KB of stderr are kept. The drain
never waits on the logger (bounded drop-oldest queue) and ends at EOF when the
worker exits. A worker that exits before connecting (session factory race) or
that the probe finds already exited now fails StartupFailed with the stderr tail.
This commit is contained in:
Joseph Doherty
2026-12-03 13:10:12 -05:00
parent 6804341152
commit ee0f836886
18 changed files with 995 additions and 26 deletions
+4 -2
View File
@@ -508,8 +508,10 @@ read loop starts after readiness so the handshake has a single owner for its
ordered frames.
`WorkerReady.record_info_pin_status` carries the worker's `MXSTATUS_PROXY`
record-info pin outcome (see `MxAccessWorkerInstanceDesign.md`). The gateway does
not capture worker stderr, so `WorkerClient` is where operators see it: a status
record-info pin outcome (see `MxAccessWorkerInstanceDesign.md`). The worker's own
`WorkerRecordInfoPin` stderr line is forwarded to the gateway log at Information
(see `WorkerProcessLauncher.md`), so `WorkerClient` is where operators see the
outcome graded: a status
starting `pinned ` is logged at Information, anything else at Warning, because an
unpinned worker pays a type-library reload on every data change. It is kept as
`IWorkerClient.RecordInfoPinStatus` and shown on the dashboard's session details