Repository navigation
CxODEV-2161: keep the engine polling after Conductor errors (3.10.1 backport) - #234
Conversation
…t is not a shutdown (CxODEV-2000) WorkflowEngineBackgroundService ran the deployment and the execution manager once. Any error, or an HTTP timeout mistaken for a shutdown, ended polling for good while the host stayed up (and, for a timeout, stayed Healthy). RunAsync is now a supervisor loop: deploy, mark running, run the execution manager; on any error that is not our own shutdown, mark not running, log an error, back off (1 s doubling to 30 s, 500 ms jitter) and start again. The backoff resets after a successful deploy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A real engine (DI wiring, hosted service, beta execution manager, HTTP client) against a fake Conductor that answers 503, hangs (request timeout) or loses the task-def registration race, then recovers. Each test checks that the engine backs off, reports not running, and completes a task queued after recovery; one also checks that a task in flight during the outage still completes. All four fail on the old loop. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…shutdown cancel a hung deploy Review findings on the supervisor loop: - Health and the backoff reset followed a successful deploy, not a successful poll. With Conductor's metadata up and its task queues down (e.g. the queue backend), the engine reported Healthy most of the time while polling nothing, and redeployed about once a second on a 4xx. TaskQueuePollingService now marks the engine running after a successful read; the background service no longer marks it after deploy and restarts the backoff only after a run that polled. Unhealthy is still set only by the background service. - Deploy takes no token, so a hung deploy blocked StopAsync. It now runs under WaitAsync(stoppingToken). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Retracted: this run was green, not red. CxO Atlas misread its own test run on |
|
CxO Atlas ran the full test suite on this head (
Passed per test class: WorkflowBuilderTests 32, StructuredErrorTests 15, WorkflowEngineBackgroundServiceTests 11, FailedTaskStructuredErrorReaderTests 8, TaskQueuePollingServiceTests 5, ContainerBuilderTests 5, EngineRecoveryTests 5, TaskDefinitionBuilderTests 2, SerializationTests 2, WorkflowItemRegistryTests 2, UtilityTests 1. v3 has no CI, so this run is the gate: Atlas merges this PR only while its head is the one tested here, then publishes its packages. |
|
Independent review of head Evidence
Findings1. Low (no CxO impact): the retry loop can still end for good. 2. Low: the description overstates 3. Low: the health store is now on the poll path. 4. Design note, not a defect: every restart redeploys all definitions. What's good
RecommendationMerge this head as it is. CxO is not exposed to finding 1. Put the finding 1 guard into #233 before 4.4.2 ships. Fixing it here would change the head that was tested. Independent review by Claude Code for Milan Svitlica. It was not written by the session that wrote this PR, and it is not an approval. |
The catch block read and cleared the health flag without a guard. If the health store threw (e.g. an IOException from FileHealthService), the exception left RunAsync and the engine stopped polling for good. Both calls are now guarded: the error is logged as a warning and the backoff continues. Found in the independent review of #234. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport of #233 to
v3(3.10.1). Fixes CxODEV-2161 and CxODEV-2000 (YouTrack) for the CxO engines, which pin ConductorSharp 3.10.x.The three code commits from #233 cherry-picked cleanly:
WorkflowEngineBackgroundService.csandTaskQueuePollingService.cswere identical onmasterandv3. With them:/healthis Healthy only while the engine actually reads its queues.See #233 for the root cause, design and before/after table.
Behaviour change to note: the old
FTL Workflow Engine Background Service encountered an (API) error(s)is gone. Each failed attempt now logs at Error:ConductorSharp engine stopped polling (attempt N); retrying in …. Alerts that matched the old FTL text need updating.Versions: Client, Engine, Patterns and KafkaCancellationNotifier go to 3.10.1. Toolkit stays 3.0.1-beta3.
Tests:
v3PRs get no CI, so this is the local run (LF checkout, net6.0 viaDOTNET_ROLL_FORWARD=Major): 88/88 passed, including the 13 new unit tests and the 5 end-to-end recovery tests.🤖 Generated with Claude Code