aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver/mount_util.go
AgeCommit message (Collapse)AuthorFilesLines
2025-12-03fix: use RemoveAll for more robust staging path cleanuporigin/fix/csi-driver-self-healingchrislusf1-1/+2
Address gemini-code-assist review - use os.RemoveAll instead of os.Remove to handle cases where the directory is not empty after an imperfect unmount. This ensures complete cleanup of stale staging paths.
2025-12-03refactor: address code review feedbackchrislusf1-3/+7
- Handle unexpected stat errors in cleanupStaleStagingPath (high priority) - Extract staging logic into stageNewVolume helper method for reuse - Extract isReadOnlyAccessMode helper to avoid duplicated read-only checks - Remove redundant mountutil.Unmount call (CleanupMountPoint already handles it)
2025-12-03fix: add self-healing for volume mount failures after driver restartchrislusf1-0/+85
This addresses issue #203 - CSI Driver Self-Healing for Volume Mount Failures. Problem: When the CSI node driver restarts, the in-memory volume cache is lost. Kubelet then directly calls NodePublishVolume (skipping NodeStageVolume), which fails with 'volume hasn't been staged yet' error. Solution: 1. Added isStagingPathHealthy() to detect healthy vs stale/corrupted mounts 2. Added cleanupStaleStagingPath() to clean up stale mount points 3. Enhanced NodeStageVolume to clean up stale mounts before staging 4. Implemented self-healing in NodePublishVolume: - If staging path is healthy: rebuild volume cache from existing mount - If staging path is stale: clean up and re-stage automatically 5. Updated Volume.Unstage to handle rebuilt volumes without unmounter Benefits: - Automatic recovery after CSI driver restarts - No manual intervention required (no kubelet/pod restarts needed) - Handles both live and dead FUSE mount scenarios - Backward compatible with normal operations Fixes #203
2023-08-10Fix: error strings should not be capitalized (ST1005)n91-1/+1
Context: https://github.com/golang/go/wiki/CodeReviewComments#error-strings https://stackoverflow.com/a/68793833
2023-08-06Use single instance of mount utility - mount.New is expensiveViktor Kuzmin1-1/+3
2023-08-06Update dependencies, move from deprecated k8s.io/utils/mount to ↵Viktor Kuzmin1-1/+1
k8s.io/mount-utils
2022-09-03Remove linux specific magic from fuse process start/stop.Viktor Kuzmin1-60/+0
Use pid from cmd.Process instead of /proc lookup Use mount specific mutex Log fuse mount process stderr and stdout for problems investigation
2022-07-29move to github.com/seaweedfs/seaweedfschrislu1-1/+1
2020-06-02compileChris Lu1-0/+87