From 7b2f5775d851e5feb49db9bf2e5412f78aebb5b9 Mon Sep 17 00:00:00 2001 From: Feng Li Date: Fri, 23 Mar 2018 09:23:51 -0700 Subject: [PATCH] Release the GIL when calling grpc_call_start_batch. --- src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi index 0892215b6d4..2e02111ddd9 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi @@ -30,9 +30,12 @@ cdef class Call: tag, operations, self if retain_self else None) batch_operation_tag.prepare() cpython.Py_INCREF(batch_operation_tag) - return grpc_call_start_batch( + cdef grpc_call_error error + with nogil: + error = grpc_call_start_batch( self.c_call, batch_operation_tag.c_ops, batch_operation_tag.c_nops, batch_operation_tag, NULL) + return error def start_client_batch(self, operations, tag): # We don't reference this call in the operations tag because