fix(server): release workers when providers stop answering#23854

open7
main
fix/issue-16636
opened2d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 2d ago
Selected thread: apps/server/src/orchestration-v2/EffectWorker.ts:783 β€” <!-- MURMUR_IGNORE --> 🟠 **High** `orchestration-v2/EffectWorker.ts:783` When this timeout interrupts a start/restart effect before its run-settlement handlers execute, exhausting the final attempt only calls `outbox.fail`; the associated run remains `starting` with no effect left to start or fail it. Handle this worker-level timeout by also settling the associated run. No longer relevant as of 6349b26ccc5d676b9bcfa77f567845355f6f3485 <!-- macroscope-meta: {"kind":"code_review"} -->
0 / 10 viewed10 files changedLine totals unavailable

apps/server/src/orchestration-v2/EffectWorker.ts Β· Earlier revision c4966136 Β· right 783

Original diff
@@ -734,7 +778,12 @@ export const layerWithOptions = (
 
           const execution = executor
             .execute(effect, { willRetry: effect.attemptCount < maxAttempts })
-            .pipe(Effect.as("executed" as const));
+            .pipe(
+              providerTurnControl(effect)
+                ? Effect.timeout(PROVIDER_TURN_CONTROL_EFFECT_TIMEOUT)

apps/server/src/orchestration-v2/EffectWorker.ts Β· Earlier revision c4966136 Β· right 782–785

Original diff
@@ -734,7 +778,12 @@ export const layerWithOptions = (
 
           const execution = executor
             .execute(effect, { willRetry: effect.attemptCount < maxAttempts })
-            .pipe(Effect.as("executed" as const));
+            .pipe(
+              providerTurnControl(effect)
+                ? Effect.timeout(PROVIDER_TURN_CONTROL_EFFECT_TIMEOUT)
+                : identity,
+              Effect.as("executed" as const),

apps/server/src/orchestration-v2/EffectWorker.ts Β· right 782–785