Files
mxaccessgw/src/ZB.MOM.WW.MxGateway.Contracts/WorkerLaunchEnvironment.cs
T
Joseph Doherty 8e720bc727
ci / windows-x86 (push) Failing after 11m18s
ci / java (push) Failing after 11m43s
ci / portable (push) Failing after 12m6s
fix(worker): bound shutdown alarm steps by the grace; watchdog stands down while shutting down; startup handshake deadline (MXA-003, WIP-007, WIP-009, #253)
2026-12-03 10:07:41 -05:00

63 lines
3.3 KiB
C#

namespace ZB.MOM.WW.MxGateway.Contracts;
/// <summary>Names of environment variables shared by the gateway worker launcher and worker process.</summary>
public static class WorkerLaunchEnvironment
{
/// <summary>Bootstrap nonce used to authenticate the worker handshake.</summary>
public const string WorkerNonce = "MXGATEWAY_WORKER_NONCE";
/// <summary>Per-attempt named-pipe connection timeout in milliseconds.</summary>
public const string PipeConnectAttemptTimeoutMilliseconds =
"MXGATEWAY_WORKER_PIPE_CONNECT_ATTEMPT_TIMEOUT_MS";
/// <summary>Bounded wait for a Write/Write2/WriteSecured/WriteSecured2 completion callback in milliseconds.</summary>
public const string WriteCompletionWaitMilliseconds =
"MXGATEWAY_WORKER_WRITE_COMPLETION_WAIT_MS";
/// <summary>Capacity of the worker's outbound MXAccess event queue.</summary>
public const string EventQueueCapacity = "MXGATEWAY_EVENT_QUEUE_CAPACITY";
/// <summary>Worker alarm polling cadence in milliseconds.</summary>
public const string AlarmPollIntervalMilliseconds = "MXGATEWAY_ALARM_POLL_INTERVAL_MS";
/// <summary>Maximum alarm records requested in one current-alarm fetch.</summary>
public const string MaxAlarmsPerFetch = "MXGATEWAY_ALARM_MAX_ALARMS_PER_FETCH";
/// <summary>
/// MXAccess client name the worker's alarm-ack writer registers with. The
/// 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";
/// <summary>
/// Grace, in milliseconds, the worker's own STA watchdog allows STA activity to go stale
/// before faulting <c>StaHung</c> (when no command is in flight). Set from
/// <c>MxGateway:Worker:WorkerHeartbeatGraceSeconds</c>; the worker's stuck ceiling must
/// exceed it.
/// </summary>
public const string HeartbeatGraceMilliseconds = "MXGATEWAY_WORKER_HEARTBEAT_GRACE_MS";
/// <summary>
/// Deadline, in milliseconds, for the worker's startup handshake (the <c>GatewayHello</c> read
/// and MXAccess initialization). Set from <c>MxGateway:Worker:StartupTimeoutSeconds</c>, the
/// same bound the gateway applies to the whole launch, so a live gateway always gives up
/// (and kills the worker) first; the worker's own deadline only matters when the gateway is
/// gone.
/// </summary>
public const string StartupTimeoutMilliseconds = "MXGATEWAY_WORKER_STARTUP_TIMEOUT_MS";
}