Skip to content

Commit edca39d

Browse files
authored
Restore behavior which persists quantum_run_streams indefinitely (#7527)
#7500 modified the `quantum_run_stream` method definition by changing the `timeout` argument from `timeout: float | None = None` to `timeout: float | object = gapic_v1.method.DEFAULT`. Setting `timeout=None` is interpreted as having no timeout at all, whereas `timeout=gapic_v1.method.DEFAULT` uses the framework-supplied default value of 60s. For bidirectional streams, the `timeout` is used to set the lifetime of the entire stream, causing batches of jobs which cumulatively take more than 60s to fail with `DEADLINE_EXCEEDED` errors. This change sets `timout=None` explicitly, restoring the behavior previously obtained via the default argument.
1 parent bad600f commit edca39d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cirq-google/cirq_google/engine/stream_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ async def _manage_stream(
205205
"""
206206
while True:
207207
try:
208-
# The default gRPC client timeout is used.
209208
response_iterable = await self._grpc_client.quantum_run_stream(
210-
_request_iterator(request_queue)
209+
_request_iterator(request_queue),
210+
timeout=None, # Persist the stream indefinitely.
211211
)
212212
async for response in response_iterable:
213213
self._response_demux.publish(response)

0 commit comments

Comments
 (0)