Persistent Independent Subprocess w/ Deadline

   428   1   1
User Avatar
Member
9 posts
Joined: 6月 2022
Online
Hello.

I am attempting to launch a executable program outside of Houdini, via TOPs through Deadline, using Deadline scheduler.

The TOP node launching the executable is a simple Python Script.

I'm able to submit the "out-of-process" pythonscript task to Deadline, get it executed without error (using subprocess). However, as soon as the Deadline task and worker are cleared, the launched process/exe terminates with it.

The below Python is an incomplete example of how I'm launching the executable.
DETACHED_PROCESS = 0x00000008
subprocess.Popen(exe_path, shell=True, env=env_dict, close_fds=True, creationflags=DETACHED_PROCESS)

It appears Deadline is working as attended when it terminates the worker/task process tree. However, I'm hoping to override this functionality to maintain the spawned "independent" subprocess.

Would anyone have any recommendations of things to try? Thank you.
User Avatar
Member
9 posts
Joined: 6月 2022
Online
Just closing this out for the future people.

Thinkbox Deadline support got back to me and explained that it's not possible to generate a persistent process that survives after the Deadline task is completed. After task completion, Deadline terminates the entire process tree. Designed that way to avoid spawning unintentional zombie processes.

My plan is to write a service app that listens for commands passed to it via sockets on the local machine, from PDG/Deadline task. This way a command can be sent out to the service app, via sockets, for the service app to execute separate from Deadline/PDG.

Cheers!
  • Quick Links