Skip to content

kill_after_timeout doesn't seem to affect clone_from function #1215

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

Open
RT4U opened this issue Apr 19, 2021 · 8 comments
Open

kill_after_timeout doesn't seem to affect clone_from function #1215

RT4U opened this issue Apr 19, 2021 · 8 comments

Comments

@RT4U
Copy link

RT4U commented Apr 19, 2021

As mentioned in the title, it just doesn't seem to work. I've tried passing as_process=False as mentioned in another issue, but that ends up in duplicate keyword args exception.

repo = git.Repo.clone_from(url, repo_folder_name, progress=None, quiet=True, filter="tree:0", no_checkout=True, depth=20, config="core.gitproxy=/home/git/git-proxy", kill_after_timeout=10)

@Byron
Copy link
Member

Byron commented Apr 20, 2021

Could you provide an example that is reproducible by executing a python script?

as_process is false by default and doesn't need to be passed in order to allow for kill_after_timeout to work.

@RT4U
Copy link
Author

RT4U commented Apr 20, 2021

Could you provide an example that is reproducible by executing a python script?

as_process is false by default and doesn't need to be passed in order to allow for kill_after_timeout to work.

This is what I am basically trying to do the issue mentioned here.

#892

I am cloning multiple repos running in a multiprocessing environment, after cloning some of the repos, the git process seems to hang on some causing the entire script to slow down ultimately hanging the whole script. Upon looking at the debug errors, it looks it's stuck in a clone_from call. So what I had to do was to kill the process after a 10 second timeout, but it wouldn't happen either.

@Byron
Copy link
Member

Byron commented Apr 21, 2021

Thanks a lot for the additional description. However, it's not what could move this issue forward as there is no way to reproduce it.

Thus I am closing it but will be happy to reopen once a script was provided.
Producing it may help to better understand how the kill_after_timeout flag is working, and maybe even shed some light on why it is not working in the case stated here.

@Byron Byron closed this as completed Apr 21, 2021
@aviadhahami
Copy link

Hey,
This is still a problem.
repro:

import git

 git.Repo.clone_from(
            "https://github.com/trustwallet/assets",
            "/tmp/output",
            depth=1,
            kill_after_timeout=0.1 # <--- This will never bail
        )

@Byron
Copy link
Member

Byron commented Nov 2, 2022

Thanks for the script, appreciated. For completeness, which OS/platform are you testing on and which GitPython version are you using (along with the python interpreter version)? Thanks again.

@aviadhahami
Copy link

Running in a Linux container python:3.9
uname -a ===> Linux 58726903057c 5.10.124-linuxkit #1 SMP Thu Jun 30 08:19:10 UTC 2022 x86_64 GNU/Linux
Python == 3.9.13
GitPython == 3.1.27

@Byron Byron reopened this Nov 4, 2022
@aviadhahami
Copy link

@Byron I may have some time to look into soon :)

@3droj7
Copy link

3droj7 commented Jul 25, 2023

It seems that because _clone uses the as_process=True the kill_after_timeout argument is completely ignored... Maybe it's better to add another handling of this argument when calling the communicate method

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

No branches or pull requests

4 participants