From 4dcff997200cc99fbdf53635206a04555fb2b27f Mon Sep 17 00:00:00 2001 From: Jaime Cura Date: Fri, 31 May 2019 17:01:14 +0200 Subject: [PATCH] Free GRPC resources on stub close Lastest versions of GRPC does not include the shutdown and destroy channel on _del_ call. (https://github.com/grpc/grpc/issues/12531). --- pydgraph/client_stub.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pydgraph/client_stub.py b/pydgraph/client_stub.py index 41a8e65..08ac853 100644 --- a/pydgraph/client_stub.py +++ b/pydgraph/client_stub.py @@ -70,5 +70,9 @@ def check_version(self, check, timeout=None, metadata=None, def close(self): """Deletes channel and stub.""" + try: + self.channel.close() + except: + pass del self.channel del self.stub