Skip to content

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

Closed
@typeless

Description

@typeless
  • 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).

Activity

tboerger

tboerger commented on Nov 25, 2016

@tboerger
Member

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.

typeless

typeless commented on Nov 25, 2016

@typeless
ContributorAuthor

@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

typeless commented on Nov 25, 2016

@typeless
ContributorAuthor
tboerger

tboerger commented on Nov 25, 2016

@tboerger
Member

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

added
issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail
on Nov 25, 2016
added this to the 1.1.0 milestone on Nov 25, 2016
typeless

typeless commented on Nov 25, 2016

@typeless
ContributorAuthor

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

typeless

typeless commented on Nov 26, 2016

@typeless
ContributorAuthor
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.

strk

strk commented on Nov 26, 2016

@strk
Member
typeless

typeless commented on Nov 27, 2016

@typeless
ContributorAuthor
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.

3 remaining items

removed
issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail
on Nov 27, 2016
modified the milestones: 1.1.0, 1.0.0 on Nov 29, 2016
tboerger

tboerger commented on Nov 29, 2016

@tboerger
Member

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

lunny

lunny commented on Feb 23, 2017

@lunny
Member

So this has been resolved by #276 ?

lunny

lunny commented on Feb 23, 2017

@lunny
Member
typeless

typeless commented on Feb 23, 2017

@typeless
ContributorAuthor

@lunny Yes.

locked and limited conversation to collaborators on Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lunny@tboerger@strk@typeless

        Issue actions

          Hanging when creating a pull request (due allegedly to a huge repository) · Issue #258 · go-gitea/gitea