Skip to content

Detect and handle stale locks #124

@Luzifer

Description

@Luzifer

As a system administrator I want to be able to trust my backup mechanism to run even if it failed once without having to manually check it every time

Observed behavior

  • Backup script runs
  • Script gets killed from whatever reason, is unable to remove its lock
  • Consecutive backups fails with lock held by XXXX
  • No notification is sent using slack channel though it's configured

Expected behavior

  • The stale lock is detected because of the registered PID is no longer running
  • Stale lock is removed, backup process is continued

OR

  • Lock is detected
  • Deadlock (PID no longer running) is detected
  • Slack channel gets notification about deadlock

Logs

# cat /var/log/duplicity/duplicity-2016-05-15_01-12.txt
--------    START DUPLICITY-BACKUP SCRIPT for docker01   --------

Attempting to acquire lock /var/log/duplicity/backup.lock
lock failed, could not acquire /var/log/duplicity/backup.lock
lock held by 3124
# ps aux | grep 3124
root      7661  0.0  0.0  11712   668 pts/3    S+   02:10   0:00 grep --color=auto 3124
#

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions