Skip to content

Create a new StuckMergeJobService

drew stachon requested to merge create-stuck-mr-service into master

What does this MR do and why?

This MR moves the merge job unsticking logic out of the StuckMergeJobsWorker and into a new MergeRequests::StuckMergeJobService

We need to incorporate unsticking functionality into merge trains, and luckily for me the logic to do that already exists, and is currently used to fix regular merge requests that had processing die in the middle of the merge, for whatever reason. I intend to use this exact logic, now tied up in a service object, to fix merge requests as the MergeTrain recovers from a killed worker.

For in-depth discussion of the problem, see #389044

The changes will be paired with a much shorter worker timespan in !121588, allowing MergeTrains to automatically recover and restart by themselves.

How to set up and validate locally

There should be absolutely no behavioral changes resulting from the merge request. It is a pure repackaging of existing logic and workflow, so it can be used in another MR.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports