python-zk / kazoo

Kazoo is a high-level Python library that makes it easier to use Apache Zookeeper.
https://kazoo.readthedocs.io
Apache License 2.0
1.3k stars 386 forks source link

Track threads created via spawn #203

Open harlowja opened 10 years ago

harlowja commented 10 years ago

Instead of spawning an arbitrary number of threads in the sequential threading handler allow for there to be a upper limit on the number of threads spawned (perhaps using a worker pool to handle these spawns) so that those threads can correctly be cleaned up when a handler is stopped. Right now those threads are spawned as daemon threads and never reclaimed, creating a hard/impossible to cleanup number of spawned threads.

StephenSorriaux commented 6 months ago

See https://github.com/python-zk/kazoo/actions/runs/8173423920/job/22345909472#step:7:14581

Fatal Python error: _enter_buffered_busy: could not acquire lock for <_io.BufferedWriter name='<stderr>'> at interpreter shutdown, possibly due to daemon threads

Possibly still a subject here