Skip to content

Conversation

@kolayne
Copy link
Owner

@kolayne kolayne commented Oct 7, 2025

Improves the way docker-on-top handles failures to perform some operations with volumes. Partially inspired by changes in #20

kolayne and others added 4 commits October 3, 2025 20:15
The wrong error variable was used when reporting some mount errors
This enables more careful treatment of volume removal:
we begin by making sure that a volume's mountpoint no longer exists
or, if it does, we unmount it (force+detach).

If that succeeds, we can then safely remove the volume (which would
fail otherwise, leaving the volume in an inconsistent state, neither
allowing to mount it nor remove it).

If unmounting the mountpoint fails, we refuse to do anything else to
the volume, leaving it exactly in the state it was before.

Update relevant parts of code accordingly. Require in tests that
volumes are removed even when an overlay remains mounted.
- Factor out the volume activation and deactivation to separate functions
  (I am not sure if it makes much difference but seems a bit cleaner);

- Define the order in which activation/deactivation attempt shall be
  performed, with the expect guarantees (see the "conceptual note");

- Update comments and log/error messages according to that new principle;

- Tests: remove the volatility requirement after the volume is messed
  with: unfortunately, there does not seem to be a way to guarantee
  volatility properties if we are unable to indicate that the last
  container has exited;

- Tests: enable the previously skipped test.

Co-authored-by: AnderG <[email protected]>
@kolayne kolayne merged commit b92632a into master Oct 7, 2025
29 checks passed
@kolayne kolayne deleted the failure_recovery branch October 7, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants