kill_after_timeout doesn't seem to affect clone_from function
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)
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.
Could you provide an example that is reproducible by executing a python script?
as_processis false by default and doesn't need to be passed in order to allow forkill_after_timeoutto work.
This is what I am basically trying to do the issue mentioned here.
https://github.com/gitpython-developers/GitPython/issues/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.
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.
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
)
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.
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 I may have some time to look into soon :)
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