11-08-2018 01:14 PM
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
11-13-2018 12:59 PM
Dug into this again today and found an answer in a Stack Overflow post: linux - How to terminate a python subprocess launched with shell=True - Stack Overflow
11-14-2018 12:42 PM
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.