• Kirill Smelkov's avatar
    pull: Don't leave backup repository locked on error · 2cc61da3
    Kirill Smelkov authored
    On pull git-backup locks backup repository to make sure another
    concurrent `git-backup pull` process is not running. However until now,
    if a pull was failing, the lock was left unreleased, which made followup
    pull attempts to fail while acquiring the lock until the lock was
    manually removed with `git update-ref -d ...`. Probably originally I
    made it like this in 6f237f22 (git-backup: Initial draft) to make sure
    that if there is a problem it does not go unnoticed and forces me to
    investigate. But in general we do _not_ need to keep the lock on error
    return after `git-backup pull` completes even abnormally.
    
    This "lock left unreleased" is causing operational issues on
    lab.nexedi.com from time to time: if a pull try fails for some, even
    temporary, reason, all next pull tries will fail until a human intervene
    and remove the lock ref.
    
    Fix it.
    
    See also: !4
    2cc61da3
git-backup.go 40.2 KB