fsspec / fsspec/filesystem_spec

Retry I/O operations on Windows

Open
#776 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

As you well know, write/delete operations are exclusive under Windows. It is quite common to run into PermissionErrors trying to delete a file that is being scanned (read) by an antivirus.

I ran into one such issue over at https://github.com/PyTorchLightning/pytorch-lightning/issues/9705 and the consensus seems to be that this should be handled by the filesystem libraries instead of peppering retry logic all over other projects.

To that end, is it possible to add options to I/O operation that require exclusivity (file/directory write/delete) that control how many times to retry the operation with some "reasonable" sleep between each attempt? Ideally the default should be that under Windows these operations retry by default so we don't have to retrofit all the python libraries in existence. Users who wish such operations to fail-fast can then set retries=0 to get the old behavior.

Thoughts?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reviewing the filesystem operation APIs and existing Windows-specific behavior, then determine which exclusive operations need configurable retries and how completion should be verified across platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.