• Yorick Peterse's avatar
    Remove lease from Event#reset_project_activity · c9bcfc63
    Yorick Peterse authored
    Per GitLab.com's performance metrics this method could take up to 5
    seconds of wall time to complete, while only taking 1-2 milliseconds of
    CPU time. Removing the Redis lease in favour of conditional updates
    allows us to work around this.
    
    A slight drawback is that this allows for multiple threads/processes to
    try and update the same row. However, only a single thread/process will
    ever win since the UPDATE query uses a WHERE condition to only update
    rows that were not updated in the last hour.
    
    Fixes gitlab-org/gitlab-ce#22473
    c9bcfc63
event_spec.rb 6.85 KB