Skip to content

Commit a997b91

Browse files
committed
fix: Isolate tracking failures from judge evaluation results
Wrap tracker.track_judge_result() in try/except inside _run_and_track so a tracking failure (e.g., shutdown LD client) does not propagate through the wrapper task and destroy the evaluation results that were successfully computed. Restores the resilience of the previous add_done_callback approach, which asyncio handled with isolation.
1 parent 381cf75 commit a997b91

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/sdk/server-ai/src/ldai/managed_model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ async def _run_and_track(eval_task: asyncio.Task) -> List[JudgeResult]:
6868
results = await eval_task
6969
for r in results:
7070
if r.success:
71-
tracker.track_judge_result(r)
71+
try:
72+
tracker.track_judge_result(r)
73+
except Exception:
74+
pass
7275
return results
7376

7477
return asyncio.create_task(_run_and_track(evaluator_task))

0 commit comments

Comments
 (0)