Skip to content
  • Richard Mansfield's avatar
    Fix race condition in cron (bug #891170) · 93639aac
    Richard Mansfield authored
    
    
    When cron finds a function with a stale (day-old) lock, just remove
    the lock and give up rather than trying to execute the function again.
    It's already pretty late, and waiting another minute for the next cron
    to start won't make a difference.
    
    This should avoid the case where two copies of cron both find the stale
    lock at the same time, and restart simultaneously.  It won't matter if
    cron_lock fails to get a $started value because the row has been
    deleted: the next instance of cron to run will be able to insert the
    row.
    
    Change-Id: I025aaf89d64f47466f1ba4c5bb8178317277ec2c
    Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
    93639aac