Multiprocessing, join(), and crashed processes

Israel Brewster ijbrewster at alaska.edu
Wed Feb 5 19:48:54 EST 2020


In a number of places I have constructs where I launch several processes using the multiprocessing library, then loop through said processes calling join() on each one to wait until they are all complete. In general, this works well, with the *apparent* exception of if something causes one of the child processes to crash (not throw an exception, actually crash). In that event, it appears that the call to join() hangs indefinitely. How can I best handle this? Should I put a timeout on the join, and put it in a loop, such that every 5 seconds or so it breaks, checks to see if the process is still actually running, and if so goes back and calls join again? Or is there a better option to say “wait until this process is done, however long that may be, unless it crashes”?
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145



More information about the Python-list mailing list