Hey SESI,
Is there a way to use python to set some (or current) TOP node as cooked?
Thanks,
Vlad
Ability to set a PDG node as cooked via python.
1868 3 1- madjestic
- Member
- 325 posts
- Joined: July 2005
- Offline
- kenxu
- Member
- 544 posts
- Joined: Sept. 2012
- Offline
- madjestic
- Member
- 325 posts
- Joined: July 2005
- Offline
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:
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
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
Edited by madjestic - June 27, 2019 05:54:18
I liked the Mustang
- chrisgreb
- Member
- 603 posts
- Joined: Sept. 2016
- Offline
Which scheduler are you using?
It sounds like you're saying the process baz.EXE never terminates, but ends up hanging for some unknown reason.
If that's the case, I think what you're doing is the best workaround - if the process won't terminate then naturally some other process has to kill it. There is an RFE to have work item timeouts, which would kill a hanging job after awhile, but in that case they would be marked as failed, which is not what you want.
It sounds like you're saying the process baz.EXE never terminates, but ends up hanging for some unknown reason.
If that's the case, I think what you're doing is the best workaround - if the process won't terminate then naturally some other process has to kill it. There is an RFE to have work item timeouts, which would kill a hanging job after awhile, but in that case they would be marked as failed, which is not what you want.
-
- Quick Links