fix(gateway): remove the worker startup-probe retry options that could never retry (#188)
WorkerProcessStartedProbe only checks HasExited and throws a non-retryable WorkerProcessLaunchException, so StartupProbeRetryAttempts and StartupProbeRetryDelayMilliseconds configured a Polly retry that no shipped probe could trigger. Real readiness is WorkerClient's WorkerReady handshake under the same StartupTimeoutSeconds budget, so the probe now runs once and the two options, their validation, the Polly pipeline (and the server's now unused Polly.Core reference) and their docs are removed. A stale value in configuration is ignored by the binder. Tests: WorkerProcessLauncherTests.LaunchAsync_WhenStartupProbeFails_DoesNotRetryTheProbe, WorkerOptions_HasNoStartupProbeRetryOptions (both fail on the old code).
This commit is contained in:
@@ -49,17 +49,15 @@ Before starting the process, the launcher validates that the configured worker
|
||||
path exists, has a `.exe` extension, contains a valid Windows Portable
|
||||
Executable header, and matches the configured `RequiredArchitecture`.
|
||||
|
||||
After the process starts, `IWorkerStartupProbe` waits for startup readiness.
|
||||
The default probe only verifies that the worker did not exit immediately. The
|
||||
worker client replaces this probe when pipe connection, hello, and
|
||||
`WorkerReady` handling are implemented.
|
||||
|
||||
Startup probing uses a bounded Polly retry policy. The gateway starts the worker
|
||||
process once, then retries only transient startup-probe failures while the
|
||||
process remains alive. The policy is configured by
|
||||
`WorkerOptions.StartupProbeRetryAttempts` and
|
||||
`WorkerOptions.StartupProbeRetryDelayMilliseconds`; the retry counter is
|
||||
recorded as `mxgateway.retries.attempted` with `area=worker_startup`.
|
||||
After the process starts, `IWorkerStartupProbe` runs once. The default probe
|
||||
only verifies that the worker did not exit immediately; a worker that has
|
||||
already exited cannot be recovered by waiting, so the probe is not retried.
|
||||
Real readiness is the pipe connection, hello, and `WorkerReady` handshake that
|
||||
`WorkerClient` performs after the launch, under the same
|
||||
`WorkerOptions.StartupTimeoutSeconds` budget. (The former
|
||||
`StartupProbeRetryAttempts` / `StartupProbeRetryDelayMilliseconds` options were
|
||||
removed because no shipped probe could ever produce a retryable failure; a
|
||||
stale value in configuration is ignored by the binder.)
|
||||
|
||||
The worker uses the exported pipe-attempt value inside its own bounded Polly
|
||||
retry loop.
|
||||
|
||||
Reference in New Issue
Block a user