Add better ttl value for loose FK cleanup worker
What does this MR do and why?
This MR improves the ttl
value for the loose FK cleanup worker.
Consider the following case:
- The cleanup worker is scheduled every 5 minutes to process records.
- The maximum allowed runtime is 3 minutes. This is enforced by the
ModificationTracker
class.
- The maximum allowed runtime is 3 minutes. This is enforced by the
- After maximum of 3 minutes (and a few seconds because it's not 100% accurate) the job finishes, and leaves less than 2 minutes to cool off until the next job is scheduled.
- Go to step 1.
In case the worker raises an error or the sidekiq process is restarted/killed, Redis will keep a lock for 1 hour which means we might not process anything during this time.
We change the ttl
from 1 hour to 3 + 1
minutes to avoid the 1 hour gap.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Adam Hegyi