feat(gateway,worker): configurable worker heartbeat send interval and stuck ceiling (mxaccessgw#218)
ci / nightly-windev (push) Has been skipped
ci / windows-x86 (push) Successful in 1m32s
ci / java (push) Successful in 2m57s
ci / portable (push) Failing after 5m1s
ci / nightly-windev (push) Has been skipped
ci / windows-x86 (push) Successful in 1m32s
ci / java (push) Successful in 2m57s
ci / portable (push) Failing after 5m1s
The worker's heartbeat send interval (5 s) and its own STA-watchdog stuck ceiling (75 s) were compile-time defaults the gateway never reached, and nothing checked that the gateway's HeartbeatGraceSeconds exceeded the real send interval, so a misconfigured grace could kill healthy workers. - New MxGateway:Worker options WorkerHeartbeatSendIntervalSeconds (default 5) and WorkerHeartbeatStuckCeilingSeconds (default 75), exported by WorkerProcessLauncher as MXGATEWAY_WORKER_HEARTBEAT_SEND_INTERVAL_MS and MXGATEWAY_WORKER_HEARTBEAT_STUCK_CEILING_MS, the same env-var path the other worker settings use. - The worker's production WorkerPipeSession reads them through WorkerPipeSessionOptions.FromEnvironment; a missing/invalid value, or a ceiling not above the worker's 15 s watchdog grace, keeps the default rather than failing the worker. - Startup validation: HeartbeatGraceSeconds > WorkerHeartbeatSendIntervalSeconds; send interval > 0; worker ceiling > 15 s; both at most 86400 s. - Docs: GatewayConfiguration, WorkerProcessLauncher (env table now also lists the previously missing MXGATEWAY_ALARM_ACK_CLIENT_NAME), worker design doc. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -28,4 +28,18 @@ public static class WorkerLaunchEnvironment
|
||||
/// Historian records it as the acknowledgement's OperatorNode.
|
||||
/// </summary>
|
||||
public const string AlarmAckClientName = "MXGATEWAY_ALARM_ACK_CLIENT_NAME";
|
||||
|
||||
/// <summary>
|
||||
/// Interval, in milliseconds, at which the worker sends heartbeats to the gateway. Set
|
||||
/// from <c>MxGateway:Worker:WorkerHeartbeatSendIntervalSeconds</c>; the gateway's
|
||||
/// <c>HeartbeatGraceSeconds</c> must exceed it or healthy workers are declared dead.
|
||||
/// </summary>
|
||||
public const string HeartbeatSendIntervalMilliseconds = "MXGATEWAY_WORKER_HEARTBEAT_SEND_INTERVAL_MS";
|
||||
|
||||
/// <summary>
|
||||
/// Ceiling, in milliseconds, after which the worker's own STA watchdog faults
|
||||
/// <c>StaHung</c> even while a command is in flight. Set from
|
||||
/// <c>MxGateway:Worker:WorkerHeartbeatStuckCeilingSeconds</c>.
|
||||
/// </summary>
|
||||
public const string HeartbeatStuckCeilingMilliseconds = "MXGATEWAY_WORKER_HEARTBEAT_STUCK_CEILING_MS";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user