[issue35122] Process not exiting on unhandled exception when using multiprocessing module

akhi singhania report at bugs.python.org
Thu Nov 1 07:15:13 EDT 2018


akhi singhania <akhi3030 at gmail.com> added the comment:

Thank you very much for the reply and the link.  It seems like I escaped that bit in the documentation, my apologises.  I can confirm that using cancel_join_thread() removes the need for explicitly calling queue.close().

May I please ask for some more clarification if you do not mind.  My understanding now is that, there are two scenarios to consider when a process using queues tries to exit:

- The default behaviour seems to be that the process must flush the queue before it exits.  This is useful as it will ensure that none of the queued data is lost which can be very useful in some circumstances.

- The alternate behaviour (which can be enabled by setting cancel_join_thread()) is that you don't care about losing the data in the queue and just want to exit.  Again this can be useful in some circumstances if you don't care if the data is lost and emptying out the queue might potentially take a long time.


Does the above sound about right?  Thank you very much for your explanation and sorry again for the noise.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35122>
_______________________________________


More information about the Python-bugs-list mailing list