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

Fix: Prevent multiple processes from copying the same file when using… #353

Merged
merged 8 commits into from
Sep 3, 2024

Conversation

dallmann-uniwue
Copy link
Contributor

… the file: protocol

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Fixes #351 by guarding copying the index.json to the cache directory with a FileLock when using the file: protocol.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Sure! 🙃

Copy link
Collaborator

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

Looks good !

@bhimrazy
Copy link
Collaborator

bhimrazy commented Sep 2, 2024

Thank you for the PR, @dallmann-uniwue.

It appears that the errors are primarily due to the change in the total count caused by the addition of lock files.
Should we adjust the total count to account for these changes?

@dallmann-uniwue
Copy link
Contributor Author

@bhimrazy
Hi!

I have taken a shot at fixing the tests. Rather then just adjusting the expected file counts, I opted to filter out the lock files. What do you think?

@bhimrazy
Copy link
Collaborator

bhimrazy commented Sep 3, 2024

@bhimrazy Hi!

I have taken a shot at fixing the tests. Rather then just adjusting the expected file counts, I opted to filter out the lock files. What do you think?

Thank you @dallmann-uniwue , Looks great. 😊

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 78%. Comparing base (8382067) to head (592cd6b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #353   +/-   ##
===================================
  Coverage    78%    78%           
===================================
  Files        34     34           
  Lines      5008   5016    +8     
===================================
+ Hits       3922   3929    +7     
- Misses     1086   1087    +1     

@dallmann-uniwue
Copy link
Contributor Author

You are welcome @bhimrazy! Thank you for working on this, litdata is making my life a lot easier!

@tchaton tchaton merged commit bc8c0fd into Lightning-AI:main Sep 3, 2024
29 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
3 participants