diff --git a/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc.py b/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc.py index 5658f4293da..42854490b78 100644 --- a/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc.py +++ b/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc.py @@ -169,8 +169,9 @@ def __init__( ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), + ('grpc.max_send_message_length', 20 * 1024 * 1024), # 20MiB + ('grpc.max_receive_message_length', -1), # unlimited + ('grpc.max_metadata_length', 10 * 1024 * 1024), # 10MiB ], ) diff --git a/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py b/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py index 56b4bfd59a2..8223fec9e6d 100644 --- a/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py +++ b/cirq-google/cirq_google/cloud/quantum_v1alpha1/services/quantum_engine_service/transports/grpc_asyncio.py @@ -214,8 +214,9 @@ def __init__( ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), + ('grpc.max_send_message_length', 20 * 1024 * 1024), # 20MiB + ('grpc.max_receive_message_length', -1), # unlimited + ('grpc.max_metadata_length', 10 * 1024 * 1024), # 10MiB ], ) diff --git a/cirq-google/cirq_google/engine/stream_manager.py b/cirq-google/cirq_google/engine/stream_manager.py index 52b42a7f5ab..dc00c14309a 100644 --- a/cirq-google/cirq_google/engine/stream_manager.py +++ b/cirq-google/cirq_google/engine/stream_manager.py @@ -123,7 +123,7 @@ async def _make_request_queue(self) -> asyncio.Queue[Optional[quantum.QuantumRun If `None` is put into the queue, the request iterator will stop. """ - return asyncio.Queue() + return asyncio.Queue(maxsize=100) def submit( self, project_name: str, program: quantum.QuantumProgram, job: quantum.QuantumJob