Open sai1274 opened 9 months ago
I created a subscription and when i do .close() on the PollSubscriber object it's not terminating the thread which it created initially. It's just going here waiting for one sec and returning https://github.com/akarneliuk/pygnmi/blob/ef224a67f58c5b9441241000f12a22b9713ed2a2/pygnmi/client.py#L1105
if i remove the timeout in .join() it never terminate.
This is the code I'm using for subscribing
from pygnmi.client import gNMIclient server_host = 'xx.xx.xx.xx' server_port = 57400 with gNMIclient(target=(server_host, server_port),username="xxxxx", password="xxxxx", insecure=True, debug=True) as client: client.connect() subscription_dict = {'subscription': [{'path': 'openconfig-interfaces:interfaces/', 'mode':'sample'}], 'mode': 'poll', 'encoding':'json'} subscription_ids = [] subscription_id = client.subscribe_poll(subscribe=subscription_dict) import pdb;pdb.set_trace() subscription_id.close()
Hey @sai1274 , PRs are welcome.
Hey @sai1274 , What would be the expectation here? just trying to understand the workflow. is the problem that thread stays open within your Linux threads once the app is terminated?
I created a subscription and when i do .close() on the PollSubscriber object it's not terminating the thread which it created initially. It's just going here waiting for one sec and returning https://github.com/akarneliuk/pygnmi/blob/ef224a67f58c5b9441241000f12a22b9713ed2a2/pygnmi/client.py#L1105
if i remove the timeout in .join() it never terminate.
This is the code I'm using for subscribing