Worker heartbeat send interval/stuck ceiling not configurable from the gateway; no grace > interval check #218

Closed
opened 2026-11-09 12:41:07 -05:00 by dohertj2 · 1 comment
Owner

The worker's heartbeat send interval (5 s) and stuck ceiling (75 s) are compile-time defaults in WorkerPipeSessionOptions; the gateway never passes them (only an env var would). Nothing validates that the gateway's HeartbeatGraceSeconds exceeds the worker's real send interval, so a misconfigured grace can kill healthy workers. Found while splitting the heartbeat options in #192.

Pass the worker's heartbeat settings from gateway config at spawn (args/env), and add a startup validation rule grace > worker send interval. Worker is net48 x86 — build on windev.

The worker's heartbeat send interval (5 s) and stuck ceiling (75 s) are compile-time defaults in `WorkerPipeSessionOptions`; the gateway never passes them (only an env var would). Nothing validates that the gateway's `HeartbeatGraceSeconds` exceeds the worker's real send interval, so a misconfigured grace can kill healthy workers. Found while splitting the heartbeat options in #192. Pass the worker's heartbeat settings from gateway config at spawn (args/env), and add a startup validation rule `grace > worker send interval`. Worker is net48 x86 — build on windev.
dohertj2 added the area:workertype:followuppriority:p3 labels 2026-11-09 12:41:07 -05:00
Author
Owner

Fixed on main 2e52f9f5: new MxGateway:Worker:WorkerHeartbeatSendIntervalSeconds (5) and WorkerHeartbeatStuckCeilingSeconds (75), exported by WorkerProcessLauncher as MXGATEWAY_WORKER_HEARTBEAT_SEND_INTERVAL_MS / _STUCK_CEILING_MS and read by WorkerPipeSessionOptions.FromEnvironment (missing/invalid → default, never fails the worker). Validator: grace > send interval, interval > 0, worker ceiling > the worker's fixed 15 s watchdog grace, both ≤ 86400 s. Docs/appsettings updated (also fixed WorkerProcessLauncher.md's 'six variables' — seven, MXGATEWAY_ALARM_ACK_CLIENT_NAME was missing). 8 Mac tests fail with launcher+validator reverted; FromEnvironment test fails on windev with the env read disabled. Evidence: windev x86 Release Worker build 0 warnings; Worker.Tests 757 passed / 12 skipped / 0 failed; Mac NonWindows.slnx 0 warnings, MxGateway.Tests 1402 passed / 2 skipped (re-run after rebase on main).

Fixed on main 2e52f9f5: new MxGateway:Worker:WorkerHeartbeatSendIntervalSeconds (5) and WorkerHeartbeatStuckCeilingSeconds (75), exported by WorkerProcessLauncher as MXGATEWAY_WORKER_HEARTBEAT_SEND_INTERVAL_MS / _STUCK_CEILING_MS and read by WorkerPipeSessionOptions.FromEnvironment (missing/invalid → default, never fails the worker). Validator: grace > send interval, interval > 0, worker ceiling > the worker's fixed 15 s watchdog grace, both ≤ 86400 s. Docs/appsettings updated (also fixed WorkerProcessLauncher.md's 'six variables' — seven, MXGATEWAY_ALARM_ACK_CLIENT_NAME was missing). 8 Mac tests fail with launcher+validator reverted; FromEnvironment test fails on windev with the env read disabled. Evidence: windev x86 Release Worker build 0 warnings; Worker.Tests 757 passed / 12 skipped / 0 failed; Mac NonWindows.slnx 0 warnings, MxGateway.Tests 1402 passed / 2 skipped (re-run after rebase on main).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/mxaccessgw#218