Skip to content

Commit 4240f64

Browse files
committed
try
1 parent bbd8d24 commit 4240f64

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

eval_protocol/pytest/remote_rollout_processor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ async def _process_row(row: EvaluationRow) -> EvaluationRow:
115115
except asyncio.CancelledError:
116116
# Distinguish intentional cancellation (Ctrl+C, test teardown) from
117117
# aiohttp-internal cancellation caused by a poisoned DNS resolver
118-
# after a server disconnect.
118+
# after a server disconnect. Task.cancelling() returns the number
119+
# of pending cancel() calls; > 0 means someone explicitly cancelled
120+
# this task.
119121
current = asyncio.current_task()
120-
if current is not None and current.cancelled():
122+
if current is not None and current.cancelling() > 0: # pyright: ignore[reportAttributeAccessIssue]
121123
raise # Intentional cancellation — propagate immediately
122124
# Network-level failure; discard the session so retries get a
123125
# fresh connection pool.

0 commit comments

Comments
 (0)