Skip to content

Acquire per-pod lock in dangling mount cleanup path#818

Open
guessi wants to merge 1 commit into
awslabs:mainfrom
guessi:fix/pod-unmounter-dangling-cleanup-lock
Open

Acquire per-pod lock in dangling mount cleanup path#818
guessi wants to merge 1 commit into
awslabs:mainfrom
guessi:fix/pod-unmounter-dangling-cleanup-lock

Conversation

@guessi

@guessi guessi commented Jun 2, 2026

Copy link
Copy Markdown
Member

Issue #, if available: #817

Description of changes:

CleanupDanglingMounts calls unmountAndRemoveMountpointSource without holding lockMountpointPod, while the normal unmount path (triggered by HandleMountpointPodUpdate) holds the lock via unmountMountpointPodIfNeeded.

This allows both paths to race on the same mount directory, where the dangling path can delete the directory while the normal path is still polling it.

This patch acquires the same per-pod lock in the dangling cleanup branch to serialize concurrent operations on the same Mountpoint Pod mount.

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

CleanupDanglingMounts calls unmountAndRemoveMountpointSource without
holding lockMountpointPod, while the normal unmount path (triggered by
HandleMountpointPodUpdate) holds the lock via unmountMountpointPodIfNeeded.

This allows both paths to race on the same mount directory, where the
dangling path can delete the directory while the normal path is still
polling it.

Acquire the same per-pod lock in the dangling cleanup branch to
serialize concurrent operations on the same Mountpoint Pod mount.
@guessi guessi requested a review from a team as a code owner June 2, 2026 07:41
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