From c72bf26af96869a742e4d72b822f3bc0d148c30f Mon Sep 17 00:00:00 2001 From: Matthew Neeley Date: Thu, 24 Feb 2022 23:50:48 -0800 Subject: [PATCH] Update quantum_run_stream to not prefetch first result --- .../quantum_v1alpha1/gapic/quantum_engine_service_client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cirq-google/cirq_google/engine/client/quantum_v1alpha1/gapic/quantum_engine_service_client.py b/cirq-google/cirq_google/engine/client/quantum_v1alpha1/gapic/quantum_engine_service_client.py index 92ef60ebfff..31b6fa72478 100644 --- a/cirq-google/cirq_google/engine/client/quantum_v1alpha1/gapic/quantum_engine_service_client.py +++ b/cirq-google/cirq_google/engine/client/quantum_v1alpha1/gapic/quantum_engine_service_client.py @@ -2106,6 +2106,9 @@ def quantum_run_stream( default_timeout=self._method_configs['QuantumRunStream'].timeout, client_info=self._client_info, ) + # Don't prefetch first result from stream, since this will cause deadlocks. + # See https://github.com/googleapis/python-api-core/pull/30 + self.transport.quantum_run_stream._prefetch_first_result_ = False return self._inner_api_calls['quantum_run_stream']( requests, retry=retry, timeout=timeout, metadata=metadata