-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
15 second hang when doing commit on repo with LFS enabled #4275
Comments
That's a good analysis.
Both |
So it seems that this is the actual root cause, and the problem could be alleviated by changing Git LFS? |
I was intrigued by this.
So maybe |
Yes changing git-lfs to stop calling In the git-lfs source, I see only one call to It seems to be used only to determine if it is running in a Cygwin/MSYS environment. If it is running in a Cygwin/MSYS environment, then it sometimes needs to translate paths. Would there be another way to determine if running in Cygwin ? Should I post this issue in git-lfs ? |
@AntAgna for a brief moment, I thought that changing https://github.com/git-lfs/git-lfs/blob/3bf8ad72b3738deca0d66d47e895710990aafd92/tools/cygwin_windows.go#L41 to call |
I have tested that and I get the same 15 second wait with |
I have installed Cygwin from cygwin.com and tried calling
I tried the I find it peculiar that the same .exe file behaves differently depending on how it was launched. I looked at the difference between the environment variables in the cmd and cygwin environments. Cygwin adds an environment variable I installed the source for the cygwin coreutils package. In the gethostname() documentation, we see :
So querying the network with a 15 seconds timeout seems to be normal behavior for this function. Launching Git Bash (either from the start menu or from c:\Program Files\Git\usr\bin\bash.exe) also regularly hangs for 15 seconds. But once Git Bash is launched, calling |
Yes, this is the common problem with some POSIX functions ( For the record, here is the implementation of that |
Apparently that implementation changed in Cygwin v3.0.0: before, it used My suspicion is that the latter call is slow in your case, the former is fast. Could you verify my suspicion @AntAgna? |
I have written a simple program to test this : TestGetComputerName It tries to call both Results:
So calling the |
That's strange. The default Maybe the cost it is in the startup of the MSYS2 runtime? Could you run |
I have captured a strace of uname.exe with the problem happening : In that trace, the time seems to be spent in I have noticed that things other than Git sometimes also freeze for 15 seconds when the VPN is disconnected. When working in git repos without LFS, the problem does not get triggered. As a workaround, I now keep the office VPN active when working from out of the office when possible. |
Would you be able to try with a custom build of the MSYS2 runtime where you modify |
Git for Windows v2.42.0(2) was released with a fix for the same symptom: long hangs when disconnected from the domain controller. Could y'all give it a try and report back if this fix happened to fix this here issue, too? |
I have installed version 2.42.0.windows.2 The issue #4459 does seem to be related as it was also describing 15 second delays. I have used a debugger to see the stack trace of uname.exe when it hangs :
The hang seems to happen in the API |
Could you please test with v2.43.0-rc2? |
My employer has replaced my work laptop with a brand new one. The new laptop is not joined to the domain. So I can't reproduce the issue anymore. |
Okay, let's close this ticket, then. |
Setup
defaults?
to the issue you're seeing?
Happens on my work laptop, which is configured to be part of a Domain.
Details
Happens in git bash, cmd, PowerShell and also from GUI apps.
Minimal, Complete, and Verifiable example
this will help us understand the issue.
I expect the commit to be finished in less than one second
Very often, it gets stuck for 15 or 16 seconds.
URL to that repository to help us with testing?
It happens on multiple repositories that have LFS enabled.
I did not try to reproduce on a public repository.
My Analysis
The problem started a few weeks ago. I think it must have started after an update to Git or an update to Windows.
The problem is intermittent: Some days it does not happen at all, some days it happens most of the time.
Many Git commands hang for ~15 seconds, including
git commit
andgit reset
.Using Git Trace2 and SysInternals Process Monitor, I have been able to see what git.exe is doing while it is hung :
git-lfs post-commit
uname
By looking at uname source, I see that it tries to lookup the hostname and domain name. I think this triggers a DNS lookup.
When I am away from the office and with the VPN disconnected, the DNS lookup for the domain fails, probably with a timeout of 15 seconds.
This explains the intermittency : The problems does not happen when I am at the office nor when I am connected to the VPN.
I think it is likely that many others are having this annoying problem.
This may be more of an MSYS/Cygwin problem.
The text was updated successfully, but these errors were encountered: