I have a use-case when I start a 3rd party software process on the farm (/foo/bar/baz.EXE), using Pyton TOP, which produces the right output and quits, but, apparently, does not terminate gracefully, so the Python TOP stays forever in “cooking” state. We created a hacky workaround it by checking for a specific file (END.txt) script and terminating the process:
process = subprocess.Popen(command)
while not os.path.isfile(outPath + '\END.txt'):
time.sleep(5)
process.terminate()
I understand that the process should terminate gracefully and hence there should be no need for the above, however we failed to trace the problem. It may be due to our farm configurations, file/processes permission issues, python configuration or a python or PDG bug… so we sort of gave up for now and use this workaround.
Cheers,
Vlad