Skip to content

Expand file lock scope to resolve concurrency issues during downloads #3063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

humengyu2012
Copy link

@humengyu2012 humengyu2012 commented May 8, 2025

Pull Request overview

Expand file lock scope to resolve concurrency issues during downloads

Details

We want to use a network file system as the cache directory (HF_HOME). After testing various network file systems(such as NFS), we observed strange errors when multiple requests concurrently download the same file.

We found that some symlink operations are protected by locks, while others are not, which can lead to conflicts.
In particular, on file systems that lack symlink support, symlink operations degrade into copy and mv commands, which further exacerbate these conflicts.

Therefore, I created this PR to expand the scope of the flock in order to resolve these conflicts.

@humengyu2012 humengyu2012 changed the title Fix race conditions on symlink-less filesystems by extending lock coverage Expand file lock scope to resolve concurrency issues during downloads May 8, 2025
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