Disable multi requests on timeout during multi-request (#1759)

_execute_multiple_query only disables batching on JSON_DECODE_FAIL_ERROR / INTERNAL_UNKNOWN_ERROR (#1025). This change applies the same pattern to a TimeoutError raised while sending a batch: set the batch size to 1 and raise _RetryableError.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kaloyan Naumov
2026-10-04 17:19:05 +03:00
committed by GitHub
parent effdf5a298
commit eed64fe013
4 changed files with 121 additions and 2 deletions

View File

@@ -245,7 +245,16 @@ class SmartProtocol(BaseProtocol):
batch_name,
pf(smart_request),
)
response_step = await self._transport.send(smart_request)
try:
response_step = await self._transport.send(smart_request)
except TimeoutError as ex:
# P300 does not respond to some batched requests (e.g. both child
# list requests together) so disable batching. Batch size is never
# 1 here as that case sends single requests above.
self._multi_request_batch_size = 1
raise _RetryableError(
"Timeout during multi request, multi requests disabled"
) from ex
if debug_enabled:
if self._redact_data:
data = redact_data(response_step, REDACTORS)