Skip to content

fix: preserve existing files when checking FSMap write access - #2122

Merged
martindurant merged 1 commit into
fsspec:masterfrom
Bortlesboat:fix/fsmap-check-preserve-existing-files
Sep 8, 2026
Merged

fix: preserve existing files when checking FSMap write access#2122
martindurant merged 1 commit into
fsspec:masterfrom
Bortlesboat:fix/fsmap-check-preserve-existing-files

Conversation

@Bortlesboat

Copy link
Copy Markdown
Contributor

Summary

Opening an FSMap with check=True can currently overwrite and delete an existing file named a; an a directory makes the check fail. Use a UUID-named write probe so the check leaves those existing entries intact and removes its own probe afterward.

Validation

  • Four new regression cases fail on upstream and pass with the fix, covering files and directories on local and memory filesystems.
  • Mapping, local and memory suites: 211 passed, 5 skipped, 11 xfailed on Python 3.13.12.
  • Core tests excluding downstream: 537 passed, 148 skipped, 2 xfailed. The run emitted three Windows socket/thread teardown warnings and exited successfully.
  • All applicable pre-commit hooks pass. Full Docker/FUSE and downstream integration suites were not run.

Post-Deploy Monitoring & Validation

For downstream adoption, check a populated mapper root with check=True and compare its keys and bytes before and after. Missing entries or leftover probe files are regression signals; callers can temporarily use check=False while investigating. The regression tests cover this check for this PR; live cloud validation remains with backend adopters.

Prepared and reviewed with Codex assistance. Review ran in the same agent session; no independent human review is claimed.


Compound Engineering

@martindurant
martindurant merged commit 35354a5 into fsspec:master Sep 8, 2026
11 checks passed
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