Skip to content

2.0rc1: hook_docker_pause/hook_docker_unpause are non-idempotent #70

Description

@karan

When hook_docker_pause is configured, run_docker_cmd() shells out to docker pause -- <list> and treats any non-zero exit as a fatal pre-hook failure (runner.c, run_docker_cmd). docker pause exits non-zero if any target container is already paused, and docker unpause likewise errors if any target is already running.

If a maintenance run is interrupted between the pause and unpause hooks (daemon restart, OOM, crash, or any external docker pause), the array is left with >=1 paused container. The next run's docker pause then hits that already-paused container, exits 1, and snapraidd aborts the entire sync with "Failed to pause docker containers". The following unpause hook also fails (mixed state), so the failure cascades on every subsequent scheduled run until the operator manually runs docker unpause.

A container that is already paused should be treated as successfully paused (idempotent); docker pause should succeed when the end state is "all listed containers paused". Likewise for unpause.

Repro env: snapraidd 4d34fc4 (2026-09-07); Docker 29.7.2; Linux x86_64; daemon started as root via systemd (User=root), drops to nobody and re-acquires root for the docker hook.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdone

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions