Merge request stuck in locked state when getting merged in a merge train
Summary
A customer reported an issue (ticket, internal) wherein a MR got stuck in a locked state when it was getting merged. The MR was in a merge train and also made the merge train stuck.
To unstuck the merge train, the MR had to be deleted.
What is the current bug behavior?
The MR shows the locked
state of the MR. State shows open while the icon is showing a merge icon and the widget shows it's being merged.
What is the expected correct behavior?
The MR should've been completely merged.
Possible fixes
Based on discussion in #389044 (comment 1250042710), we can do the following:
- Set the
ttl
for deduplication ofMergeTrains::RefreshWorker
to 1 hour. - Modify
MergeTrains::RefreshService
to unstuck stucked merge trains (update the status tostale
frommerging
). We also need to unlock (MergeRequest#unlock
) the MR associated to a merge train so it can be merged again. If the MR was already merged though (the merge commit is present) but the MR is unlocked, we should update the state tomerged
.
When implementing the proposed fix, try to test by breaking your local environment like what was done in #389044 (comment 1303396262).
Edited by Patrick Bajao