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

open7
main
fix/issue-16636
opened1d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 1d ago
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