feat(gateway,worker): configurable worker watchdog grace; heartbeat settings in effective config and Settings page (mxaccessgw#224)
- New MxGateway:Worker:WorkerHeartbeatGraceSeconds (default 15), exported as MXGATEWAY_WORKER_HEARTBEAT_GRACE_MS and read by WorkerPipeSessionOptions.FromEnvironment (a grace the ceiling does not exceed falls back to the default so the worker still starts). Validation now checks WorkerHeartbeatStuckCeilingSeconds against the configured grace; the copied WorkerWatchdogGraceSeconds constant is gone. - EffectiveWorkerConfiguration and the dashboard Settings page now show the worker heartbeat send interval, watchdog grace and stuck ceiling (render test added). - Docs updated. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -310,10 +310,23 @@ public sealed class GatewayOptionsValidator : OptionsValidatorBase<GatewayOption
|
||||
$"MxGateway:Worker:WorkerHeartbeatStuckCeilingSeconds must be at most {MaximumWorkerHeartbeatSeconds}.");
|
||||
}
|
||||
|
||||
if (options.WorkerHeartbeatStuckCeilingSeconds <= WorkerOptions.WorkerWatchdogGraceSeconds)
|
||||
AddIfNotPositive(
|
||||
options.WorkerHeartbeatGraceSeconds,
|
||||
"MxGateway:Worker:WorkerHeartbeatGraceSeconds must be greater than zero.",
|
||||
builder);
|
||||
|
||||
if (options.WorkerHeartbeatGraceSeconds > MaximumWorkerHeartbeatSeconds)
|
||||
{
|
||||
builder.Add(
|
||||
$"MxGateway:Worker:WorkerHeartbeatStuckCeilingSeconds must be greater than the worker's {WorkerOptions.WorkerWatchdogGraceSeconds}-second watchdog grace.");
|
||||
$"MxGateway:Worker:WorkerHeartbeatGraceSeconds must be at most {MaximumWorkerHeartbeatSeconds}.");
|
||||
}
|
||||
|
||||
// The worker refuses a ceiling at or below its own grace, so hold it above the configured
|
||||
// grace (not a copied constant) -- mxaccessgw#224.
|
||||
if (options.WorkerHeartbeatStuckCeilingSeconds <= options.WorkerHeartbeatGraceSeconds)
|
||||
{
|
||||
builder.Add(
|
||||
"MxGateway:Worker:WorkerHeartbeatStuckCeilingSeconds must be greater than WorkerHeartbeatGraceSeconds.");
|
||||
}
|
||||
|
||||
AddIfNotPositive(
|
||||
|
||||
Reference in New Issue
Block a user