Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kill_after_timeout watchdog is not able to kill the nested git processes #895

Open
eekwong opened this issue Jul 17, 2019 · 1 comment
Open

Comments

@eekwong
Copy link

eekwong commented Jul 17, 2019

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))
@Byron
Copy link
Member

Byron commented Jul 21, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants