-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Prevent hang in git cat-file if repository is not a valid repository and other fixes #17991
Conversation
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
…sPrefixes Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
…ory (Partial go-gitea#17991) Unfortunately it appears that if git cat-file is run in an invalid repository it will hang until stdin is closed. This will result in deadlocked /pulls pages and dangling git cat-file calls if a broken repository is tried to be reviewed or pulls exists for a broken repository. Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
82c7f36
to
ac6ed7f
Compare
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Jimmy Praet <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #17991 +/- ##
==========================================
- Coverage 45.28% 45.26% -0.03%
==========================================
Files 820 820
Lines 90973 91046 +73
==========================================
+ Hits 41196 41209 +13
- Misses 43219 43274 +55
- Partials 6558 6563 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird behavior for cat-file
to not fail (almost sounds like a bug). Let's hope that other commands won't show this behavior as well.
Hi @zeripath, could you please explain how this resolves #14734? I can't see how these changes will help in cases of slow performance, apart from in specific cases where hangs are occurring (which isn't what was reported). I have a repository that suffers from the performance problems, taking minutes to open PRs with large change counts. |
Also, what is meant by "not a valid repository"? Directories that aren't part of a repository (no The former doesn't seem to cause a hang for me: gitserver:~$ git version
git version 2.31.1
gitserver:~$ mkdir not-a-repo
gitserver:~$ cd not-a-repo/
gitserver::~/not-a-repo$ git cat-file --batch
fatal: not a git repository (or any of the parent directories): .git If it's specific to a certain type of corrupt repository, I'm not sure how to test it. |
@ryanfitzsimon This PR should resolve part of the hang, so I have reopened #14734 |
…ory (Partial #17991) (#17992) * Prevent hang in git cat-file if the repository is not a valid repository (Partial #17991) Unfortunately it appears that if git cat-file is run in an invalid repository it will hang until stdin is closed. This will result in deadlocked /pulls pages and dangling git cat-file calls if a broken repository is tried to be reviewed or pulls exists for a broken repository. Signed-off-by: Andrew Thornton <[email protected]> * placate lint Signed-off-by: Andrew Thornton <[email protected]> * fix compilation bug Signed-off-by: Andrew Thornton <[email protected]> * Add the missing directories to the testrepos * fixup! Add the missing directories to the testrepos * and ensure that all of the other places have the objects directories too Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
Ok. I had thought that we had finally found the reason for this problem but clearly you disagree. Could you update the issue and report back if things have changed on main at all? |
## [1.15.8](https://github.com/go-gitea/gitea/releases/tag/v1.15.8) - 2021-12-19 * BUGFIXES * Reset locale on login (go-gitea#18023) (go-gitea#18025) * Fix reset password email template (go-gitea#17025) (go-gitea#18022) * Fix outType on gitea dump (go-gitea#18000) (go-gitea#18016) * Ensure complexity, minlength and isPwned are checked on password setting (go-gitea#18005) (go-gitea#18015) * Fix rename notification bug (go-gitea#18011) * Prevent double decoding of % in url params (go-gitea#17997) (go-gitea#18001) * Prevent hang in git cat-file if the repository is not a valid repository (Partial go-gitea#17991) (go-gitea#17992) * Prevent deadlock in create issue (go-gitea#17970) (go-gitea#17982) * TESTING * Use non-expiring key. (go-gitea#17984) (go-gitea#17985) Signed-off-by: Andrew Thornton <[email protected]>
## [1.15.8](https://github.com/go-gitea/gitea/releases/tag/v1.15.8) - 2021-12-19 * BUGFIXES * Reset locale on login (#18023) (#18025) * Fix reset password email template (#17025) (#18022) * Fix outType on gitea dump (#18000) (#18016) * Ensure complexity, minlength and isPwned are checked on password setting (#18005) (#18015) * Fix rename notification bug (#18011) * Prevent double decoding of % in url params (#17997) (#18001) * Prevent hang in git cat-file if the repository is not a valid repository (Partial #17991) (#17992) * Prevent deadlock in create issue (#17970) (#17982) * TESTING * Use non-expiring key. (#17984) (#17985) Signed-off-by: Andrew Thornton <[email protected]> * Update CHANGELOG.md Co-authored-by: 6543 <[email protected]>
…and other fixes (go-gitea#17991) This PR contains multiple fixes. The most important of which is: * Prevent hang in git cat-file if the repository is not a valid repository Unfortunately it appears that if git cat-file is run in an invalid repository it will hang until stdin is closed. This will result in deadlocked /pulls pages and dangling git cat-file calls if a broken repository is tried to be reviewed or pulls exists for a broken repository. Fix go-gitea#14734 Fix go-gitea#9271 Fix go-gitea#16113 Otherwise there are a few small other fixes included which this PR was initially intending to fix: * Fix panic on partial compares due to missing PullRequestWorkInProgressPrefixes * Fix links on pulls pages due to regression from go-gitea#17551 - by making most /issues routes match /pulls too - Fix go-gitea#17983 * Fix links on feeds pages due to another regression from go-gitea#17551 but also fix issue with syncing tags - Fix go-gitea#17943 * Add missing locale entries for oauth group claims * Prevent NPEs if ColorFormat is called on nil users, repos or teams.
This PR contains multiple fixes. The most important of which is:
Prevent hang in git cat-file if the repository is not a valid repository
Unfortunately it appears that if git cat-file is run in an invalid
repository it will hang until stdin is closed. This will result in
deadlocked /pulls pages and dangling git cat-file calls if a broken
repository is tried to be reviewed or pulls exists for a broken
repository.
Fix It takes a long time to open a big pull request page #14734
Fix iowait and memory consumption are skyrocketing regularly #9271
Fix Task running since 2 weeks #16113
Otherwise there are a few small other fixes included which this PR was initially intending to fix: