Commit Graph

16 Commits

Author SHA1 Message Date
Yorick Peterse 7f30bb9c29
Run background migrations with a minimum interval
This adds a minimum interval to BackgroundMigrationWorker, ensuring
background migrations of the same class only run once every 5 minutes.
This prevents a thundering herd problem where scheduled migrations all
run at once due to their delays having been expired (e.g. as the result
of a queue being paused for a long time).

If a job was recently executed it's rescheduled with a delay that equals
the remaining time of the job's lease. This means that if the lease
expires in two minutes we only need to wait two minutes, instead of
five.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/41624
2018-01-05 16:23:25 +01:00
Tiago Botelho 39298575a8 Adds exclusive lease to Git garbage collect worker. 2017-09-07 18:52:04 +01:00
Paul Charlton cb3b4a15e6 Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
Gabriel Mazetto 43c3fa4455 Introduce #renew for ExclusiveLease 2017-06-24 03:40:58 +02:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Jacob Vosmaer 6bcc52a536 Refine Git garbage collection 2016-11-04 14:30:11 +01:00
Yorick Peterse 3b4af59a5f
Don't schedule ProjectCacheWorker unless needed
This changes ProjectCacheWorker.perform_async so it only schedules a job
when no lease for the given project is present. This ensures we don't
end up scheduling hundreds of jobs when they won't be executed anyway.
2016-10-25 16:02:36 +02:00
Valery Sizov 33f786b5d3 clean up ExclusiveLease 2016-04-13 13:12:05 +03:00
Jacob Vosmaer 0163e27631 Add Gitlab::Redis connection pool 2016-04-04 17:00:09 +02:00
Jacob Vosmaer be3675c8ac Explain why ExclusiveLease has no #cancel
[ci skip]
2016-03-24 13:51:33 +01:00
Jacob Vosmaer 7b2bf4ce75 Typo 2016-03-10 18:41:57 +01:00
Jacob Vosmaer 261214efc2 Make comment less ambivalent 2016-03-10 18:39:50 +01:00
Jacob Vosmaer 3729c0822a Remove unnecessary random key 2016-03-10 17:05:36 +01:00
Jacob Vosmaer 66d5d9229d Improve comment 2016-03-10 12:58:51 +01:00
Jacob Vosmaer e7df3f51c9 Move method to User 2016-03-10 12:37:14 +01:00
Jacob Vosmaer cda0b7e1b1 Rename ExpiringLock to ExclusiveLease 2016-03-10 10:41:16 +01:00