I have a problem when using multiprocessing in Python. One of my processes stops silently. How to get the signal and restart it automatically.
My code is as below. the p0 stops silently without any warning after hours of running. I have tried using is_alive()
but still do not know how to put it in the right flow to restart whenever the process down.
def func_15():
while 1:
get_data
send_data
...
if __name__ == '__main__':
logging.info('===========PROCESS BEGIN================')
logging.info('TIME15 - CREATING PROCESS')
p0 = Process(target = func_15m, args = ())
logging.info('TIME1 - CREATING PROCESS')
p1 = Process(target = func_1h, args = ())
logging.info('TIME4 - CREATING PROCESS')
p2 = Process(target = func_4h, args = ())
p0.start()
p1.start()
p2.start()
p0.join()
p1.join()
p2.join()
Please help! Thanks so much!