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
+2 -1
View File
@@ -210,7 +210,8 @@ Consequences, and how this sits with the existing failover/reconcile design:
per minute) `AlarmSnapshotTruncated` warning carrying the cap, the record
counts, and the running truncated-fetch total — identifiers and counts only,
never tag names, values, limits, or comments. Be honest about its reach: it
goes to the worker's console/stderr, which is captured on dev hosts but is
goes to the worker's stderr, which the gateway forwards to its own log
(since mxaccessgw#259; before that the line was lost), but it is
not a metric, not a dashboard tile, and not part of any session-status or
alarm-feed payload, so a production deployment can truncate indefinitely
without anyone noticing. The structural signal that fixes this landed