Merge pull request #15666 from nathanielmanistaatgoogle/15662

Retain references to channel arguments.
pull/14879/head
Nathaniel Manista 7 years ago committed by GitHub
commit b441dbbc2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi
  2. 3
      src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi
  3. 2
      src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
  4. 1
      src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi

@ -15,10 +15,12 @@
cimport cpython
# TODO(https://github.com/grpc/grpc/issues/15662): Reform this.
cdef void* _copy_pointer(void* pointer):
return pointer
# TODO(https://github.com/grpc/grpc/issues/15662): Reform this.
cdef void _destroy_pointer(void* pointer):
pass

@ -69,3 +69,6 @@ cdef class Channel:
cdef grpc_arg_pointer_vtable _vtable
cdef _ChannelState _state
# TODO(https://github.com/grpc/grpc/issues/15662): Eliminate this.
cdef tuple _arguments

@ -390,6 +390,7 @@ cdef class Channel:
def __cinit__(
self, bytes target, object arguments,
ChannelCredentials channel_credentials):
arguments = () if arguments is None else tuple(arguments)
grpc_init()
self._state = _ChannelState()
self._vtable.copy = &_copy_pointer
@ -410,6 +411,7 @@ cdef class Channel:
grpc_completion_queue_create_for_next(NULL))
self._state.c_connectivity_completion_queue = (
grpc_completion_queue_create_for_next(NULL))
self._arguments = arguments
def target(self):
cdef char *c_target

@ -23,6 +23,7 @@ cdef class Server:
cdef bint is_shutdown # notification of complete shutdown received
# used at dealloc when user forgets to shutdown
cdef CompletionQueue backup_shutdown_queue
# TODO(https://github.com/grpc/grpc/issues/15662): Elide this.
cdef list references
cdef list registered_completion_queues

Loading…
Cancel
Save