helm/internal/fileutil
Orgad Shaneh 3575c04de7 fix(downloader): prevent concurrent file access errors on Windows
When DownloadTo runs in parallel for the same ref and version, both
processes try to write the same target file, causing "Access Denied"
errors on Windows.

This change refactors the file locking mechanism based on maintainer
feedback:
- Add LockedAtomicWriteFile to internal/fileutil package to encapsulate
  locking logic
- Use the new function for both chart and provenance files
- Lock is cross-process safe and automatically released on process exit
- Files are only written if they don't already exist (avoiding
  duplicate work)

The TestParallelDownloadTo test verifies the fix works correctly.

Fixes #31633

Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
2026-01-25 11:42:19 +02:00
..
fileutil.go Updating to helm.sh/helm/v4 2024-12-26 16:33:51 -05:00
fileutil_test.go improve fileutil test coverage 2025-09-12 20:46:28 +02:00
fileutil_unix.go fix(downloader): prevent concurrent file access errors on Windows 2026-01-25 11:42:19 +02:00
fileutil_windows.go fix(downloader): prevent concurrent file access errors on Windows 2026-01-25 11:42:19 +02:00