Hanging when creating a pull request (due allegedly to a huge repository) #81

Closed
opened 2025-11-02 03:07:56 -06:00 by GiteaMirror · 12 comments
Owner

Originally created by @typeless on GitHub (Nov 25, 2016).

  • Gitea version (or commit ref):
    https://github.com/gogits/gogs/commit/8ee14db51ebc92728e1edba4545c7d4ea4b21c65
    This is exactly the Gogs release version 0.9.97.0901

  • Git version:
    git version 2.7.4

  • Operating system:
    `Ubuntu Server 16.04

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • SQLite
  • Log gist:

31630 Nov 25 16:37:37 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:37:37: Started POST /test/BCM-Android-Linux-Test/compare/master...mura:master for 192.168.222.65
31631 Nov 25 16:37:37 DIR-101 gogs[32041]: 2016/11/25 16:37:37 [D] Session ID: f64a95bdfc4e1143
31632 Nov 25 16:37:37 DIR-101 gogs[32041]: 2016/11/25 16:37:37 [D] CSRF Token: cl6PKtu_cFKSebHPtlJdAv0Y9-k6MTQ4MDA1OTY5NjgzOTI2NTkzMA==
31633 Nov 25 16:37:37 DIR-101 gogs[32041]: 2016/11/25 16:37:37 [T] PullRequest[0].testPatch (patchPath): /home/git/gogs-repositories/test/bcm-android-linux-test.git/pulls/1.patch
31634 Nov 25 16:41:38 DIR-101 gogs[32041]: 2016/11/25 16:41:38 [T] PushToBaseRepo[37]: pushing commits to base repo 'refs/pull/1/head'
31635 Nov 25 16:41:38 DIR-101 gogs[32041]: 2016/11/25 16:41:38 [T] DeliverHooks [repo_id: 37]
31636 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [T] Pull request created: 37/19
31637 Nov 25 16:41:39 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:41:39: Completed /test/BCM-Android-Linux-Test/compare/master...mura:master 302 Found in 4m1.573187867s
31638 Nov 25 16:41:39 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:41:39: Started GET /test/BCM-Android-Linux-Test/pulls/1 for 192.168.222.65
31639 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [D] Session ID: f64a95bdfc4e1143
31640 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [D] CSRF Token: cl6PKtu_cFKSebHPtlJdAv0Y9-k6MTQ4MDA1OTY5NjgzOTI2NTkzMA==
31641 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [D] Template: repo/issue/view
31642 Nov 25 16:41:39 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:41:39: Completed /test/BCM-Android-Linux-Test/pulls/1 200 OK in 266.321449ms

Description

If I am not misinterpreting the log, it took around 4 minutes to reply the POST of the PR creation.
...

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39529892-hanging-when-creating-a-pull-request-due-allegedly-to-a-huge-repository?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).
Originally created by @typeless on GitHub (Nov 25, 2016). - Gitea version (or commit ref): `https://github.com/gogits/gogs/commit/8ee14db51ebc92728e1edba4545c7d4ea4b21c65` This is exactly the Gogs release version `0.9.97.0901` - Git version: `git version 2.7.4` - Operating system: `Ubuntu Server 16.04 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x] SQLite - Log gist: ``` 31630 Nov 25 16:37:37 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:37:37: Started POST /test/BCM-Android-Linux-Test/compare/master...mura:master for 192.168.222.65 31631 Nov 25 16:37:37 DIR-101 gogs[32041]: 2016/11/25 16:37:37 [D] Session ID: f64a95bdfc4e1143 31632 Nov 25 16:37:37 DIR-101 gogs[32041]: 2016/11/25 16:37:37 [D] CSRF Token: cl6PKtu_cFKSebHPtlJdAv0Y9-k6MTQ4MDA1OTY5NjgzOTI2NTkzMA== 31633 Nov 25 16:37:37 DIR-101 gogs[32041]: 2016/11/25 16:37:37 [T] PullRequest[0].testPatch (patchPath): /home/git/gogs-repositories/test/bcm-android-linux-test.git/pulls/1.patch 31634 Nov 25 16:41:38 DIR-101 gogs[32041]: 2016/11/25 16:41:38 [T] PushToBaseRepo[37]: pushing commits to base repo 'refs/pull/1/head' 31635 Nov 25 16:41:38 DIR-101 gogs[32041]: 2016/11/25 16:41:38 [T] DeliverHooks [repo_id: 37] 31636 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [T] Pull request created: 37/19 31637 Nov 25 16:41:39 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:41:39: Completed /test/BCM-Android-Linux-Test/compare/master...mura:master 302 Found in 4m1.573187867s 31638 Nov 25 16:41:39 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:41:39: Started GET /test/BCM-Android-Linux-Test/pulls/1 for 192.168.222.65 31639 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [D] Session ID: f64a95bdfc4e1143 31640 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [D] CSRF Token: cl6PKtu_cFKSebHPtlJdAv0Y9-k6MTQ4MDA1OTY5NjgzOTI2NTkzMA== 31641 Nov 25 16:41:39 DIR-101 gogs[32041]: 2016/11/25 16:41:39 [D] Template: repo/issue/view 31642 Nov 25 16:41:39 DIR-101 gogs[32041]: [Macaron] 2016-11-25 16:41:39: Completed /test/BCM-Android-Linux-Test/pulls/1 200 OK in 266.321449ms ``` ## Description If I am not misinterpreting the log, it took around 4 minutes to reply the POST of the PR creation. ... <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/39529892-hanging-when-creating-a-pull-request-due-allegedly-to-a-huge-repository?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github). </bountysource-plugin>
GiteaMirror added the type/bug label 2025-11-02 03:07:56 -06:00
Author
Owner

@tboerger commented on GitHub (Nov 25, 2016):

Since you are posting this issue to Gitea, have you also tried the same with Gitea master? Just to confirm this is a remaining issue.

@tboerger commented on GitHub (Nov 25, 2016): Since you are posting this issue to Gitea, have you also tried the same with Gitea master? Just to confirm this is a remaining issue.
Author
Owner

@typeless commented on GitHub (Nov 25, 2016):

@tboerger Since the log was captured on a production server which is not entirely controlled by me, it's a bit of risky to upgrade and test the setup right now. I am trying to come up with a way to make it easier to be reproduced (and test it with latest Gitea).

@typeless commented on GitHub (Nov 25, 2016): @tboerger Since the log was captured on a production server which is not entirely controlled by me, it's a bit of risky to upgrade and test the setup right now. I am trying to come up with a way to make it easier to be reproduced (and test it with latest Gitea).
Author
Owner

@typeless commented on GitHub (Nov 25, 2016):

The alleged culprit https://github.com/go-gitea/gitea/blob/master/models/pull.go#L342, according to the log.

@typeless commented on GitHub (Nov 25, 2016): The alleged culprit https://github.com/go-gitea/gitea/blob/master/models/pull.go#L342, according to the log.
Author
Owner

@tboerger commented on GitHub (Nov 25, 2016):

I will mark it as a bug for now, but please try to provide more feedback on this.

@tboerger commented on GitHub (Nov 25, 2016): I will mark it as a bug for now, but please try to provide more feedback on this.
Author
Owner

@typeless commented on GitHub (Nov 25, 2016):

@tboerger Confirmed. The latest Gitea exhibits the same behavior.

@typeless commented on GitHub (Nov 25, 2016): @tboerger Confirmed. The latest Gitea exhibits the same behavior.
Author
Owner

@typeless commented on GitHub (Nov 26, 2016):

testPatch()
  UpdateLocalCopyBranch(branch string)
    UpdateLocalCopyBranch(repoPath, localPath, branch string)
        // Clone, Checkout, or Pull

The above is the relevant call trace for creating a PR.

The method testPatch is responsible for reporting the status of the PR. (PullRequestStatusConflict, PullRequestStatusChecking or PullRequestStatusMergeable)

The problem here is that Gogs/Gitea will try to clone or checkout the entire repository just for checking if there is any conflict. FWIW, the cloned repository will be stored at data/tmp.

@typeless commented on GitHub (Nov 26, 2016): ``` testPatch() UpdateLocalCopyBranch(branch string) UpdateLocalCopyBranch(repoPath, localPath, branch string) // Clone, Checkout, or Pull ``` The above is the relevant call trace for creating a PR. The method `testPatch` is responsible for reporting the status of the PR. (`PullRequestStatusConflict`, `PullRequestStatusChecking` or `PullRequestStatusMergeable`) The problem here is that Gogs/Gitea will try to clone or checkout the entire repository just for checking if there is any conflict. FWIW, the cloned repository will be stored at `data/tmp`.
Author
Owner

@strk commented on GitHub (Nov 26, 2016):

It looks like git apply supports --check to only check w/out
applying. This should remove the need to clone the repository.

@strk commented on GitHub (Nov 26, 2016): It looks like `git apply` supports `--check` to only check w/out applying. This should remove the need to clone the repository.
Author
Owner

@typeless commented on GitHub (Nov 27, 2016):

git read-tree --index-output=${INDEX_TMP_FILE} ${BRANCH_NAME}
GIT_INDEX_FILE=${INDEX_TMP_FILE} git apply --check --cached ${PATCH_FILE}

The above seems to be a viable approach to test patches with solely bare repository. I have tested on my laptop with a much simplified Gitea setup.

@typeless commented on GitHub (Nov 27, 2016): ``` git read-tree --index-output=${INDEX_TMP_FILE} ${BRANCH_NAME} GIT_INDEX_FILE=${INDEX_TMP_FILE} git apply --check --cached ${PATCH_FILE} ``` The above seems to be a viable approach to test patches with solely bare repository. I have tested on my laptop with a much simplified Gitea setup.
Author
Owner

@tboerger commented on GitHub (Nov 29, 2016):

Moved like the pending pr to 1.1 because it requires further testing

@tboerger commented on GitHub (Nov 29, 2016): Moved like the pending pr to 1.1 because it requires further testing
Author
Owner

@lunny commented on GitHub (Feb 23, 2017):

So this has been resolved by #276 ?

@lunny commented on GitHub (Feb 23, 2017): So this has been resolved by #276 ?
Author
Owner

@lunny commented on GitHub (Feb 23, 2017):

@typeless

@lunny commented on GitHub (Feb 23, 2017): @typeless
Author
Owner

@typeless commented on GitHub (Feb 23, 2017):

@lunny Yes.

@typeless commented on GitHub (Feb 23, 2017): @lunny Yes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#81