I am new in python and have query. I am providing error_callback for multiprocessing pool. An exception is thrown inside thread. Thread has try..except handler and it raises exception. That exception is when reraised inside error_callback causes hang in program, whereas if it is not reraised in error_callback works fine. I want to know underlying cause.
try:
result = pool.apply_async(func,error_callback=log_error) # func raises exception
result.get()
pool.close()
except Exception as e:
pool.terminate()
finally:
pool.join()
def log_error(error):
raise Exception(error) # This causes hangs while
def log_error(error):
print(error) # works fine