Merging conflict checking takes a long time #43
Labels
No Label
Service
Buildbot
Service
Chat
Service
Gitea
Service
Translate
Type
Bug
Type
Config
Type
Deployment
Type
Feature
Type
Setup
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/blender-projects-platform#43
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This can take for example 10 minutes, and causes developers to be blocked from merging their pull requests in the meantime.
When a commit is pushed to the main branch, all pull requests targeting that branch will begin conflict checking (
patch_checker
). This involves operations like making a temporary shared, bare clone of the repository. Even if this would take just a couple of seconds, multiply that by 125 open pull requests and it's going to take a while to get through everything.A few ideas:
push_update
andpatch_checker
can run in parallel instead of just 1 worker doing it. Also the number of workers never seems to go beyond 1.There is also the following display bug. On pushing changes to a PR, it can show this error, which gets resolved once
push_update
completes.Workers seem to be configured in such a way that first all the conflict checking has to be completed before it handles more push updates.
The error happens before
push_update
has run for the new commit, once it gets queued forpr_patch_checker
it's gone.The SHA is different in the following code in
routers/web/repo/pull.go
.I imagine dedicating/prioritizing a worker to
push_update
would mostly hide this, since pushes are not that frequent and it's probably waiting forpr_patch_checker
tasks to complete.Here's an example that seems to have been stuck on checking for days with nothing pending to update it:
blender/blender#104677
Not sure how that happens, if for example restarting the server gets things stuck, or if it crashed while checking.
It appears the order of conflict checking is from oldest to newest PR, which is almost the opposite of what we want. I made a simple change in our branch to prioritize most recently updated, though this is not global. We can see if this helps.
cb362b7e28
I also confirmed that it is possible for
push_update
andpatch_checker
works to run in parallel, and I think we should tweak our configuration to ensure one is not blocked by the other.Regarding stuck pull requests. It appears that on
2023/02/17 14:35:36
there were a ton of different errors, various different operations failing at the same time or in quick succession.This includes conflict checking for a few dozens PRs that (from a quick sample) all seems to be stuck waiting.
@Arnd not sure if you remember anything particular happening at that time, or can correlate it with something.
This configuration may help speeding things up:
It's also configurable through the web UI (and lost on restart). So I can experiment with it a bit there to see if it works well.
There's a workaround in the branch now for the stuck conflict checking:
2093ca5175
Conflict checking still seems slow for new PRs even with the ordering and workers. Maybe because the ordering is not global.
Patch to speed things up submitted upstream:
https://github.com/go-gitea/gitea/pull/23219
The various fixes were deployed, I will consider this resolved.
This still seems to take longer than I expect, I noticed it taking more than 10 minutes after a commit.
Why is not clear, checking the running processes I didn't see the previously slow git commands. There were
git cat-file
processes running, but those seem to be used for many purposes so it's not clear what they are for and if they are holding up conflict checking. Maybe language stats? Or just viewing of big commits or diffs.Ideally we could replicate this on the test instance with trace logging enabled, though also not sure it's worth spending much time on this now.
Merging conflict checking takes a long time and shows as broken in the meantimeto Merging conflict checking takes a long timeWorkaround for this is now: