The following code, sometimes returns as error that python can't compare None with an integer.
This means that p.exitcode is None even after p.terminate(). However in the docs is stated that
This (the exitcode) will be
Noneif the process has not yet terminated.
How is this possible?
The code:
for j in range(3):
p = multiprocessing.Process(target = functions_that_hangs, args = (arguments,))
p.start()
p.join(180)
if p.is_alive: # used to check if process is still runing
p.terminate()
if p.exitcode >= 0 : # used to check if process completed successfully
break