Skip to content

Hold a lock for the entire PodmanRemote.release() #24

Description

@comps

This is because the new PodmanProvisioner and its .stop() may remove "isolated" (custom subdir) storage location, which needs all containers to be (ideally) stopped and unmounted. The logic inside .stop() already does that after calling .release() for all remotes, but an external thread could interfere here.

If the thread calls .release(), it would set self.release_called = True, which would insta-complete the .stop()-called .release() even while that external threads hasn't finished releasing (running podman rm).

A with self._lock: across the whole podman rm calling section would make .stop() block and wait until the external thread finished releasing the Remote, avoiding the race.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions