Backport ExclusiveLeaseGuard from EE to CE
The worker concern ExclusiveLeaseGuard was created in gitlab-org/gitlab-ee!3187 to simplify the use of an exclusive lock in workers.
There are many workers which implement these method themselves and could better use this concern instead.
Relation discussion
The following discussion from !3172 (merged) should be addressed:
-
@DouweM started a discussion: (+1 comment) Nice! Should we look for other workers with leases that could benefit from this concern? If not now, in a tech debt issue.