diff options
author | Ken Payson <kpayson@google.com> | 2016-07-11 10:38:39 -0700 |
---|---|---|
committer | Ken Payson <kpayson@google.com> | 2016-07-11 10:38:39 -0700 |
commit | 136ea365e37b611f6b3f7ab94f221737ad3e1cc6 (patch) | |
tree | 5a62352facb5a6523f6d03e8aa1080bb038e2107 /src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi | |
parent | c1bfe124ab0d151f7619f4fefc08244bd1dd4750 (diff) |
Hold onto the GIL in __dealloc__ functions
When a child thread triggers __dealloc__ as part of a thread being
joined, the thread is already considered to be "joined", and so
releasing the GIL can allow the main thread to proceed to exit,
which introduces shutdown race conditions/memory leaks.
Diffstat (limited to 'src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi')
-rw-r--r-- | src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi index 3e03b6efe1..4f2d51b03f 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi @@ -171,5 +171,4 @@ cdef class Server: # much but repeatedly release the GIL and wait while not self.is_shutdown: time.sleep(0) - with nogil: - grpc_server_destroy(self.c_server) + grpc_server_destroy(self.c_server) |