Skip to content
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

Use exist_ok=False for os.makedirs #41

Merged
merged 3 commits into from
Feb 22, 2024
Merged

Conversation

dimitris-flyr
Copy link
Contributor

https://docs.python.org/3/library/os.html#os.makedirs

We receive FileExistsError when multiple processes use the same file cache

@tsroten
Copy link
Owner

tsroten commented Feb 17, 2024

Hello! Thanks for your contribution! I'm a little confused on what you're attempting to accomplish here. Do you think you could describe what behavior you're trying to fix or change?

@dimitris-flyr
Copy link
Contributor Author

Hi @tsroten. The issue is when you have multiple processes using the same file cache. In that case, you end up with race conditions, where both processes are trying to create the same file and you receive a FileExistsError

src/fcache/cache.py Outdated Show resolved Hide resolved
Co-authored-by: Thomas Roten <[email protected]>
Copy link
Owner

@tsroten tsroten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@tsroten tsroten merged commit 659e412 into tsroten:main Feb 22, 2024
11 checks passed
@tsroten
Copy link
Owner

tsroten commented Feb 23, 2024

@dimitris-flyr This is now released in version 0.5.2, thanks again!

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