Merge request page loses state
Summary
If merge requests take a long time to complete, and multiple merge requests are submitted to merge at the same time, the one that comes in second eventually displays the incorrect state on the MR page. Customer is experiencing this on 10.1.3. It reproduces on 11.7.0.
Customer issue: https://gitlab.zendesk.com/agent/tickets/111732
Steps to reproduce
- Create a repo
- Create a custom pre-receive hook on the repo, with a sleep in it. I used 3 minutes. This is just to simulate a long time required to complete a merge. The customer reporting this issue does have a complex custom pre-receive hook.
- Stage two separate merge requests on the repo.
- Bring up browser windows showing both merge requests, waiting to be merged.
- Click
Merge
on one of the merge requests and wait until that page is refreshed to display "merging in progress". - Click
Merge
on the other merge request. - Now both merge requests will show "merging in progress" until the first one completes and shows itself as "Merged".
- After some period of time the second merge request stops spinning and goes back to its initial state with the green
Merge
button ready to be pushed. But what you will actually see is an error likeMergeService ERROR: root/merge-test2!2 - Conflicts detected during merge
in the production log. No matter how many times you clickMerge
on this merge request it logs the same error and comes back to this same state. - If you merge the latest master into the second merge branch, push it to the server, and refresh the page, you can successfully merge the second merge request.
What is the current bug behavior?
Merge request page does not show correct state of the merge request.
What is the expected correct behavior?
The user should see there was an error with the merge, and it should be clear they need to refresh and try again.
Edited by Diana Stanley