Skip to content

Handle ErrNotExist in PodUnmounter wait loops and source removal#816

Open
guessi wants to merge 1 commit into
awslabs:mainfrom
guessi:fix/pod-unmounter-handle-enoent
Open

Handle ErrNotExist in PodUnmounter wait loops and source removal#816
guessi wants to merge 1 commit into
awslabs:mainfrom
guessi:fix/pod-unmounter-handle-enoent

Conversation

@guessi

@guessi guessi commented Jun 2, 2026

Copy link
Copy Markdown
Member

Issue #, if available: #815

Description of changes:

When the mount source directory is concurrently removed by another cleanup path, waitUntilMountpointIsUnmounted, waitUntilMountpointIsUnused, and os.Remove return errors instead of treating the absence as the desired end state.

This patch treats fs.ErrNotExist as success in all three locations since a non-existent path satisfies the postcondition of each operation:

  1. waitUntilMountpointIsUnmounted — path gone means it is no longer a mountpoint
  2. waitUntilMountpointIsUnused — path gone means no references remain
  3. os.Remove in unmountAndRemoveMountpointSource — path gone means removal already happened

This is consistent with the existing ErrNotExist guard at the top of unmountAndRemoveMountpointSource.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

When the mount source directory is concurrently removed (e.g., by
another cleanup path), waitUntilMountpointIsUnmounted,
waitUntilMountpointIsUnused, and os.Remove would return errors instead
of treating the absence as the desired end state.

Treat fs.ErrNotExist as success in all three locations since a
non-existent path satisfies the postcondition of each operation.
@guessi guessi requested a review from a team as a code owner June 2, 2026 07:40
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.

1 participant