-
Notifications
You must be signed in to change notification settings - Fork 69
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
Adds option to disable filelock, updates tests (Issue #90) #91
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wonderful! Thank you so much.
I left one tiny comment if you don't mind making a small edit to the new readme section.
README.md
Outdated
@@ -173,6 +174,35 @@ cppimport.settings['lock_timeout'] = 10*60 # 10 mins | |||
|
|||
You should not use `force_rebuild` when importing concurrently. | |||
|
|||
### Acquiring the lock hangs or times out unexpectedly - what's going on? | |||
Certain filesystems do not support file locking. You can disable the lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind giving an example or two so people might have a better guess of whether their OS supports locking or not?
Also looks like the CI flake8 checks are failing on some of the new code. There's a pre-commit config that should get things set up correctly to avoid those issues. but you're also welcome to just flake8 directly. |
I also invited you as a collaborator. Once the CI is passing, feel free to merge this when you're ready. |
…ing and flock test.
Thanks! Yeah, it seems like we should just remove Python 3.7 from the CI. |
Fixes #90
This PR adds the
use_filelock
option to cppimport's global settings (True
by default). By setting this toFalse
, users are no longer protected from multiple processes competing to rebuild an extension. This is necessary on filesystems that don't support file locking, e.g. [here].(https://docs.nersc.gov/performance/io/dvs/#:~:text=DVS%20doesn't%20support%20file,locking%2C%20please%20use%20Perlmutter%20Scratch.)The README has been updated to describe this behavior. In
test_cppimport.py
, all tests EXCEPT the multiprocessing test have been updated to disable the file lock. The multiprocessing test only runs with the invocationpytest --multiprocessing
, and it does not disable the file lock to test this feature.Verified that all tests passing (2 warnings). Feedback welcome!