GitPython icon indicating copy to clipboard operation
GitPython copied to clipboard

kill_after_timeout watchdog is not able to kill the nested git processes

Open eekwong opened this issue 6 years ago • 3 comments

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:

  1. git pull
  2. git fetch
  3. git-remote-http
  4. 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))

eekwong avatar Jul 17 '19 00:07 eekwong

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 :/.

Byron avatar Jul 21 '19 00:07 Byron