Richard Purdie <richard.pur...@linuxfoundation.org> added the comment:

Even my hack to call _writer.close() doesn't seem to be enough, it makes the 
problem rarer but there is still an issue. 
Basically, if you call cancel_join_thread() in one process, the queue is 
potentially totally broken in all other processes that may be using it. If for 
example another has called join_thread() as it was exiting and has queued data 
at the same time as another process exits using cancel_join_thread() and exits 
holding the write lock, you'll deadlock on the processes now stuck in 
join_thread() waiting for a lock they'll never get.
I suspect the answer is "don't use cancel_join_thread()" but perhaps the docs 
need a note to point out that if anything is already potentially exiting, it 
can deadlock? I'm not sure you can actually use the API safely unless you stop 
all users from exiting and synchronise that by other means?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41714>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to