This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients akhi singhania, pablogsal
Date 2018-10-31.20:11:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541016694.61.0.788709270274.issue35122@psf.upfronthosting.co.za>
In-reply-to
Content
Unless I don't understand the issue correctly, this is documented here:

https://docs.python.org/3/library/multiprocessing.html#multiprocessing-programming

Bear in mind that a process that has put items in a queue will wait before terminating until all the buffered items are fed by the “feeder” thread to the underlying pipe. (The child process can call the Queue.cancel_join_thread method of the queue to avoid this behaviour.)

This means that whenever you use a queue you need to make sure that all items which have been put on the queue will eventually be removed before the process is joined. Otherwise you cannot be sure that processes which have put items on the queue will terminate. Remember also that non-daemonic processes will be joined automatically.


In you example, if you add:

ch._queue.get()

before raising the exception, the program does not hang anymore once the item is taken out of the queue.
History
Date User Action Args
2018-10-31 20:11:34pablogsalsetrecipients: + pablogsal, akhi singhania
2018-10-31 20:11:34pablogsalsetmessageid: <1541016694.61.0.788709270274.issue35122@psf.upfronthosting.co.za>
2018-10-31 20:11:34pablogsallinkissue35122 messages
2018-10-31 20:11:34pablogsalcreate