Thread._wait_for_tstate_lock() never returns

冷暖自知 提交于 2019-12-05 04:09:36
brandonmpace

I'm not 100% certain it's the reason you're seeing this as you are using Windows, but I encountered this on Linux with Python 3.6 in a similar scenario.

I was using .shutdown() on a concurrent.futures.ThreadPoolExecutor and the program would seem to hang up. Sometimes it would finally exit after 30-60 seconds.

Ctrl-C always resulted in a traceback showing it was sitting in _wait_for_tstate_lock()

Note: in Python 3 a second Ctrl-C actually exits

My problem occurred when the function submitted was using time.sleep() in a loop.

Looking at the HtmlFileTracer implementation in current nodepy code on github I see a similar scenario to what I was doing, (continuously loop and sleep for an interval unless some sort of flag was set)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!