Skip to content

Use ExclusiveLeaseGuard module in StuckBuilds workers

drew stachon requested to merge use-exclusive-lease-module into master

What does this MR do and why?

This MR implements an exclusive lease for the StuckCiJobsWorker and Ci::StuckBuilds::DropRunningWorker using the common logic in ExclusiveLeaseGuard, instead of implementing our own inside the worker class. In addition to centralizing the logic itself, the specs are much cleaner since we don't need to test our re-rolled lease guards individually.

@dbalexandre pointed this out during maintainer review of the Ci::StuckBuilds::DropScheduledService, so I'm going back to clean these up in the same way.

MR acceptance checklist

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

Edited by drew stachon

Merge request reports