inlife / nexrender

📹 Data-driven render automation for After Effects
https://www.nexrender.com
MIT License
1.58k stars 322 forks source link

Windows process AfterFX.exe is not killed when no logging is reported for 60 seconds. #982

Open Tillaert opened 3 months ago

Tillaert commented 3 months ago

Describe the bug Windows process AfterFX.exe is not killed when no logging is reported for 60 seconds. Node process exits.

Information about environment Windows Server 2019. Remaining process:


Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
AfterFX.com                   2560 Services                   1  4,764,060 K

Expected behavior The AfterFX.exe is killed.

Additional info

inlife commented 3 months ago

Any ideas on how to kill a specific AfterFX process related to that particular worker?

Assuming we have lets say 4 workers running in parallel, the problem is that we don't want to accidentally kill a process related to one of the "healthy" workers that are busy on rendering actual videos.

Tillaert commented 3 months ago

I have no idea. The way we run is, that we have one runner per environment, but that environment doesn't finish, because a process is still running.

I can kill the environment, after a timeout, however, NexRender's logging timeout cannot be disabled (I now set it to Number.MAX_SAFE_INTEGER). If that timeout kicks in, it returns a value (through an exception) which stops the external time-out mechanism.

Due to the nature of AfterEffects, this problem might not be solvable. It would help if the maxUpdateTimeout can be set to zero, disabling the timer (similar to maxRenderTimeout )

inlife commented 3 months ago

Thanks for the info. I'll think of possible solutions.

I wonder, what is the way you separate the environments? This approach sounds very interesting.

Tillaert commented 3 months ago

I run aftereffects in a VM, using nexrender to configure the job, and when all the processes are done, the VM is destroyed. The dangling process causes the VM not to finish. I could investigate killing the VM from the host, once NexRender has finished.

igalness commented 1 month ago

Maybe on Windows we can use something like https://github.com/inlife/nexrender/pull/996 To kill aerender and all related to aerender child process (like AfterFX.exe )

igalness commented 1 month ago

After running some tests on Windows 11 + Node 20 LTS + AE 2023 , it looks like instance.kill('SIGINT') only terminates the aerender.exe process and leaves AfterFX.exe process spawned by it, still running

mario1in commented 3 weeks ago

@Tillaert Using VM sounds like an interesting solution, especially for more reliable concurrent processing. Could you please provide a detailed of your solution? Very appreciate!!