Skip to content

Commit 1901579

Browse files
Jepson2kclaude
andcommitted
Keep the per-call I/O deadline over endpoint setup as well as the reply
The per-call deadline moved inside _request, which no longer bounded endpoint setup and its retries: an io() against an absent peer waited the client's full retry budget. The outer deadline is back around the call; the inner one still keeps the query to a single attempt. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent d751bc9 commit 1901579

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎parol6/client/async_client.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,13 @@ async def io(self, *, timeout: float | None = None) -> list[int] | None:
902902
isinstance(timeout, bool) or not math.isfinite(timeout) or timeout <= 0
903903
):
904904
raise ValueError("I/O timeout must be positive and finite")
905-
resp = await self._request(IOCmd(), timeout=timeout)
905+
# The outer deadline also bounds endpoint setup and its retries on an
906+
# absent peer; the inner one keeps the query to a single attempt.
907+
try:
908+
async with asyncio.timeout(timeout):
909+
resp = await self._request(IOCmd(), timeout=timeout)
910+
except TimeoutError:
911+
return None
906912
return resp.io if isinstance(resp, IOResultStruct) else None
907913

908914
async def joint_speeds(self) -> list[float] | None:

0 commit comments

Comments
 (0)