diff options
author | 2018-06-07 13:14:03 -0700 | |
---|---|---|
committer | 2018-06-07 13:14:03 -0700 | |
commit | b441dbbc2c534f88bb671b4ca1564e4ef65c3e36 (patch) | |
tree | c5fa04881c136e7cfa31da83ae27e7305386a152 /src/python/grpcio/grpc/_cython | |
parent | 0cdf00839b8188a7e41195d3e40265445a2fd476 (diff) | |
parent | 9c86b20bacbb92ed9b8b43b56b2e2fdefcecedae (diff) |
Merge pull request #15666 from nathanielmanistaatgoogle/15662
Retain references to channel arguments.
Diffstat (limited to 'src/python/grpcio/grpc/_cython')
4 files changed, 8 insertions, 0 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi index 65de30884c..aecd3d7b11 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/arguments.pyx.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 diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi index eefc685c0b..f067d76fab 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pxd.pxi @@ -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 diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi index 72e74e84ae..8c37a3cf85 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi @@ -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 diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi index 4588db30d3..52cfccb677 100644 --- a/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi +++ b/src/python/grpcio/grpc/_cython/_cygrpc/server.pxd.pxi @@ -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 |