Sergei Zobov <ser...@szobov.ru> added the comment:

I've decided to make the test more clean, so I added `time.sleep` and now we 
can be sure that here is enough time for queue's underlying process to 
synchronize all variables:
https://github.com/szobov/cpython/compare/master...regression-test-on-multiprocessing-queue-feeder-ignore-exception

It shows that sometimes `Queue._sem` will never be decreased.
https://github.com/szobov/cpython/blob/master/Lib/multiprocessing/queues.py#L266
If it's undesirable behavior, would it be better to ignore this lines: 
https://github.com/szobov/cpython/blob/master/Lib/multiprocessing/queues.py#L257-L259
 ?

But in my thoughts the problem is in the functions `util._exit_function` and 
`util.is_exiting`. It's look like that `Queue._thread` share the same variable 
`util._exiting` with the process that started this thread. If you'll try to 
print it you see that when function `util._exit_function` executed for process 
it changes the value of `util._exiting` flag to `True` and after, from 
`Queue._thread`, the value for this flag stay `True`. But it's the daemon 
process and it should still work, isn't it? Or I'm missing something important 
here.

----------

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

Reply via email to