Python Script Snap still running sub process on stop

Hi -

I’m using the script snap to execute some external code on a server and running subprocess.check_output to execute it leaves the script running if I stop the pipeline.

Is there a way to guarantee the script gets halted when I stop my pipeline? Not sure what’s going on under the hood.

Thanks,

-James

Dug into this again today and found an answer in a Stack Overflow post: https://stackoverflow.com/questions/4789837/how-to-terminate-a-python-subprocess-launched-with-shell-true

Would having a “clean up” method call be useful for the script snap? That is, a function that gets called before the pipeline goes into a finished state.

In your case, when it gets invoked, the script could terminate the subprocess and clean up any other things that might be lingering during the execution.