Skip to content

Commit 2bde066

Browse files
authored
Fix: close consensus node gRPC channels in Client.close() (#2203)
Signed-off-by: Mohit Yadav <ymohit799057@gmail.com>
1 parent 724625c commit 2bde066

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/hiero_sdk_python/client/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,18 @@ def close(self) -> None:
200200
Closes any open gRPC channels and frees resources.
201201
Call this when you are done using the Client to ensure a clean shutdown.
202202
"""
203+
# Close mirror channel
203204
if self.mirror_channel is not None:
204205
self.mirror_channel.close()
205206
self.mirror_channel = None
206207

207208
self.mirror_stub = None
208209

210+
# Fix: Close all consensus node channels
211+
if self.network and self.network.nodes:
212+
for node in self.network.nodes:
213+
node._close()
214+
209215
def set_transport_security(self, enabled: bool) -> Client:
210216
"""
211217
Enable or disable TLS for consensus node connections.

0 commit comments

Comments
 (0)