-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Git.exe Processes Hanging / Not Cleaning Up #18734
Comments
My suspicion is that it's not that the git files are hanging - the request opening them is. If you press the cancel button although they'll stay in the process hierarchy on monitor the command they've opened should cancel. The problem is that the request is hanging somewhere. |
Seems to be related to the index file in the temp folder:
Can be reproduced on every push. |
This is what we have seen in our log file, error wise: Most of the errors are this: (hundreds of them with different temp file names.)
Unsure on these ones:
Bunch of name lookup failures, not harmful, just noting they are happening:
If I had to guess as well, the ones from |
After a restart and flushed log, here is what's present as the git.exe's start piling up now:
There are currently 3 stuck instances, which aligns to the |
I'm also seeing a bunch of processes piling on, one for each repo. As well, also seeing the unable to remove tmp index file errors. After a few hours, every repo is a 500, but a restart fixes it all like above. These are the processes i'm seeing being backed up: |
Ok it looks like there has to be a deadlock here. The logs above aren't really pointing very clearly to what the problem could be or is. Hmm... Any chance you enable pprof? [server]
...
ENABLE_PPROF=true Then whilst there is one of these blocked processes could you run on the server: (and preferably nothing else going on)
This should help us to figure out where a deadlock could possibly be occuring by examining the goroutines stack. |
Here's a pprof log:
Here is also level 1 trace info:
|
Here's the full goroutine stack dump as well:
|
I've narrowed down one of the causes that will leave the git.exe hanging. It is happening when checking a diff. For example, the following steps can be reproduced to cause hung processes:
This will trigger a hung process. (Refreshing/reloading the page will make a new hung git.exe each time its loaded as well.) This appears to be only one of the causes of the hung processes though. There still seems to be others happening not just from diffs. |
Here are the results of my stack dump after it started being locked up: https://p.teknik.io/LueHh |
Thanks for the fixes! Does Gitea have a build artifact server or similar that I can pull the updated exe from until an official release is pushed? I don't have an environment setup currently to compile go projects. |
Updated to that version and no more hung processes showing up in the monitor list of processes (so far). |
Gitea Version
1.16.1
Git Version
2.35.1.windows.2
Operating System
Windows Server 2012 R2
How are you running Gitea?
Database
MySQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
When running for an extended period of time, we are noticing that git.exe instances are left open/hanging. After about 25-30 instances are left open, the site just starts throwing 500 errors. It becomes impossible to do anything on the site outside of viewing the main page and admin panel.
This issue seems to be an exact copy of this: #17138
I am seeing the same thing.
Monitor page shows tons of entries for things like this:
There are also other monitored processes stuck:
And so on. The main one is the first reported entry, there are lots of those ones.
This is a bit rough to diagnose as it does not happen immediately. It takes a few hours before we start seeing the instances begin hanging.
Screenshots
No response
The text was updated successfully, but these errors were encountered: