I'm working with the multiprocessing module in Python (2.7.3) and want to debug some stuff going on in my workers. However, I seem to not be able to catch any exceptions in the worker threads.
A minimal example:
import multiprocessing as mp
a=[1]
def worker():
print a[2]
def pool():
pool = mp.Pool(processes=1)
pool.apply_async(worker, args = ())
pool.close()
pool.join()
print "Multiprocessing done!"
if __name__ == '__main__':
pool()
This is expected to raise an IndexError, but my output only is
Multiprocessing done!
Is there a way to show me all exceptions occuring in the worker threads without manually raising my own?