GitPython
GitPython copied to clipboard
kill_after_timeout watchdog is not able to kill the nested git processes
I am using GitPython 2.0.2.
While having kill_after_timeout in the pull() e.g. g.pull(kill_after_timeout=10)
Before the process killing, there were four processes running:
- git pull
- git fetch
- git-remote-http
- git fetch-pack
After the timeout, (3) and (4) remained.
Should _kill_process() be recursively called like the following?
if local_pid.isdigit():
_kill_process(local_pid) # is it necessary?
child_pids.append(int(local_pid))
Thanks a lot for sharing your findings!
Indeed, the way it kills the process is SIGKILL, which as far as I know can/will(?) leave child processes detached. So killing the entire process tree seems to be the right thing to do right now. In theory, making recursive calls could work.
Stray processes could be a real issue in long running processes :/.