python changes

reviewable/pr17308/r2
yang-g 6 years ago
parent 545c555d31
commit 3c61849461
  1. 1
      src/core/lib/iomgr/fork_posix.cc
  2. 2
      src/python/grpcio/grpc/_cython/_cygrpc/call.pyx.pxi
  3. 2
      src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
  4. 2
      src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi
  5. 8
      src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
  6. 2
      src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
  7. 2
      src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
  8. 2
      src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi

@ -49,7 +49,6 @@ bool registered_handlers = false;
void grpc_prefork() {
skipped_handler = true;
grpc_maybe_wait_for_async_shutdown();
// This may be called after core shuts down, so verify initialized before
// instantiating an ExecCtx.
if (!grpc_is_initialized()) {

@ -87,7 +87,7 @@ cdef class Call:
def __dealloc__(self):
if self.c_call != NULL:
grpc_call_unref(self.c_call)
grpc_shutdown()
grpc_shutdown_blocking()
# The object *should* always be valid from Python. Used for debugging.
@property

@ -399,7 +399,7 @@ cdef _close(Channel channel, grpc_status_code code, object details,
_destroy_c_completion_queue(state.c_connectivity_completion_queue)
grpc_channel_destroy(state.c_channel)
state.c_channel = NULL
grpc_shutdown()
grpc_shutdown_blocking()
state.condition.notify_all()
else:
# Another call to close already completed in the past or is currently

@ -118,4 +118,4 @@ cdef class CompletionQueue:
self.c_completion_queue, c_deadline, NULL)
self._interpret_event(event)
grpc_completion_queue_destroy(self.c_completion_queue)
grpc_shutdown()
grpc_shutdown_blocking()

@ -61,7 +61,7 @@ cdef int _get_metadata(
cdef void _destroy(void *state) with gil:
cpython.Py_DECREF(<object>state)
grpc_shutdown()
grpc_shutdown_blocking()
cdef class MetadataPluginCallCredentials(CallCredentials):
@ -125,7 +125,7 @@ cdef class SSLSessionCacheLRU:
def __dealloc__(self):
if self._cache != NULL:
grpc_ssl_session_cache_destroy(self._cache)
grpc_shutdown()
grpc_shutdown_blocking()
cdef class SSLChannelCredentials(ChannelCredentials):
@ -191,7 +191,7 @@ cdef class ServerCertificateConfig:
def __dealloc__(self):
grpc_ssl_server_certificate_config_destroy(self.c_cert_config)
gpr_free(self.c_ssl_pem_key_cert_pairs)
grpc_shutdown()
grpc_shutdown_blocking()
cdef class ServerCredentials:
@ -207,7 +207,7 @@ cdef class ServerCredentials:
def __dealloc__(self):
if self.c_credentials != NULL:
grpc_server_credentials_release(self.c_credentials)
grpc_shutdown()
grpc_shutdown_blocking()
cdef const char* _get_c_pem_root_certs(pem_root_certs):
if pem_root_certs is None:

@ -319,7 +319,7 @@ cdef extern from "grpc/grpc.h":
grpc_op_data data
void grpc_init() nogil
void grpc_shutdown() nogil
void grpc_shutdown_blocking() nogil
int grpc_is_initialized() nogil
ctypedef struct grpc_completion_queue_factory:

@ -134,7 +134,7 @@ cdef class CallDetails:
def __dealloc__(self):
with nogil:
grpc_call_details_destroy(&self.c_details)
grpc_shutdown()
grpc_shutdown_blocking()
@property
def method(self):

@ -151,4 +151,4 @@ cdef class Server:
def __dealloc__(self):
if self.c_server == NULL:
grpc_shutdown()
grpc_shutdown_blocking()

Loading…
Cancel
Save