You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for implementing this library, running great except one little thing.
I'm using the lib on a headless raspberry pi in a long-running process. To detect changes of my soundtouch-devices i'm callnig libsoundtouch.discover_devices frequently (e.g. all 30 minutes). After some while, i'm getting this error:
File "/usr/lib/python2.7/threading.py", line 736, in start
_start_new_thread(self.__bootstrap, ())
error: can't start new thread
Testscript
#!/usr/bin/env python# -*- coding: utf-8 -*-importthreadingimportlibsoundtouchforiinrange(10):
print("starting discovery... ", end='')
libsoundtouch.discover_devices(timeout=1)
print("active threads are now %s"%threading.active_count())
Output
starting discovery... active threads are now 4
starting discovery... active threads are now 7
starting discovery... active threads are now 10
starting discovery... active threads are now 13
starting discovery... active threads are now 16
starting discovery... active threads are now 19
starting discovery... active threads are now 22
starting discovery... active threads are now 25
starting discovery... active threads are now 28
starting discovery... active threads are now 31
So it looks like every call leaves 3 open threads. I'd looked into the code but i didn't find anything suspicious...
Any ideas?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
chwiede
added a commit
to chwiede/libsoundtouch
that referenced
this issue
Mar 18, 2018
Figured out my problem. ServiceBrowser.cancel() should be called in discover_devices.
Additonally i've added zeroconf as parameter. So it's possible to keep control over this instance. Default it's set to None, and it will be created in method as before.
Another approach would be to clean up the created zeroconf-instance, but this needs some time.
Please have a look, if accepted i'll make a pull request.
Hi,
thanks for implementing this library, running great except one little thing.
I'm using the lib on a headless raspberry pi in a long-running process. To detect changes of my soundtouch-devices i'm callnig
libsoundtouch.discover_devices
frequently (e.g. all 30 minutes). After some while, i'm getting this error:Testscript
Output
So it looks like every call leaves 3 open threads. I'd looked into the code but i didn't find anything suspicious...
Any ideas?
Thanks in advance!
The text was updated successfully, but these errors were encountered: