Skip to content

gitea hanging with git 2.43.1 #29141

Closed
Closed
@tycho

Description

@tycho

Description

I noticed that gitea was hanging when attempting to view commits (via /<team>/<repo>/commit/<hash>), but only with git 2.43.1 installed. "ps" showed a bunch of cat-file --batch-check, cat-file --batch, and check-attr invocations of git, which were making no progress. I attached strace to one of the git child processes and it was simply blocked on reading from stdin. I downgraded to git 2.43.0 and gitea started being able to view commits and index repositories.

I tried cranking the log level up to Debug and other than reporting "router: slow" messages for the commit URLs, it didn't seem to have any complaints, e.g. here's what happens on attempting to view a commit URL:

Feb 12 01:25:10 korriban gitea[14813]: 2024/02/12 01:25:10 ...dules/git/command.go:290:Run() [D] git.Command.RunDir(/var/lib/gitea/repos/organization/repo.git): /usr/bin/git -c protocol.version=2 -c credential.helper= read-tree ca9da37ae9c977b9ab06fe21d515b1cd9f1ba563
Feb 12 01:25:10 korriban gitea[14813]: 2024/02/12 01:25:10 ...dules/git/command.go:290:Run() [D] git.Command.RunDir(/var/lib/gitea/repos/organization/repo.git): /usr/bin/git -c protocol.version=2 -c credential.helper= check-attr --stdin -z --cached linguist-vendored linguist-generated linguist-language gitlab-language
Feb 12 01:25:13 korriban gitea[14813]: 2024/02/12 01:25:13 ...eb/routing/logger.go:68:func1() [I] router: polling   GET /user/events for [2604:4080:xxxx]:0, elapsed 3211.7ms @ events/events.go:18(events.Events)
Feb 12 01:25:14 korriban gitea[14813]: 2024/02/12 01:25:14 ...eb/routing/logger.go:68:func1() [W] router: slow      GET /Organization/Repo/commit/ca9da37ae9c977b9ab06fe21d515b1cd9f1ba563 for [2604:4080:xxxx]:0, elapsed 3675.9ms @ repo/commit.go:271(repo.Diff)

And again this only seems to happen with git 2.43.1 installed. Any idea what could be going on? Is this an upstream git regression?

Gitea Version

All

Git Version

2.43.1

Workaround

Downgrade git to <=2.43.0 or upgrade to >= 2.43.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedissue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPissue/workaroundit is or has a workaroundtype/bugtype/upstreamThis is an issue in one of Gitea's dependencies and should be reported there

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions