Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Thread Termination in gNMI Client Subscription #140

Open
sai1274 opened this issue Nov 21, 2023 · 2 comments
Open

Issue with Thread Termination in gNMI Client Subscription #140

sai1274 opened this issue Nov 21, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@sai1274
Copy link
Contributor

sai1274 commented Nov 21, 2023

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

self._subscribe_thread.join(1)

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()
@akarneliuk
Copy link
Owner

Hey @sai1274 ,
PRs are welcome.

@akarneliuk akarneliuk added the bug Something isn't working label Dec 20, 2023
@akarneliuk
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants