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

unlock file before closing #967

Closed
wants to merge 1 commit into from

Conversation

dschwoerer
Copy link

Unlocking ensures that if a new thread has spawned and thus there are
still copies of the fd around, the file get's still unlocked and can be
read again.

Unlocking ensures that if a new thread has spawned and thus there are
still copies of the fd around, the file get's still unlocked and can be
read again.
@derobins
Copy link
Member

This needs a test. Probably something in test/swmr.c, where we already have a test_file_locking() test that could be expanded.

@lrknox
Copy link
Collaborator

lrknox commented Sep 21, 2021

Please note also that the 1.10/master branch is used exclusively for HDF5 1.10 releases. Pull requests should preferably go to the develop branch first, or for changes appropriate for only HDF5 1.10, to the hdf5_1_10 branch.

@dschwoerer
Copy link
Author

This needs a test. Probably something in test/swmr.c, where we already have a test_file_locking() test that could be expanded.

Something like:
open file (with locking), fork, close in one thread, try to open again, ensure it is open-able, delete other thread?

@dschwoerer
Copy link
Author

Please note also that the 1.10/master branch is used exclusively for HDF5 1.10 releases. Pull requests should preferably go to the develop branch first, or for changes appropriate for only HDF5 1.10, to the hdf5_1_10 branch.

Thanks for the info, I will rebase to develop ...

@derobins
Copy link
Member

derobins commented Oct 7, 2021

This needs a test. Probably something in test/swmr.c, where we already have a test_file_locking() test that could be expanded.

Something like: open file (with locking), fork, close in one thread, try to open again, ensure it is open-able, delete other thread?

Something like that, but keep in mind that Windows doesn't have fork. I can map a test that does fork + exec to Windows concepts, but the "fork then do one thing if you are the parent and another if you are the child" pattern is not a thing on Windows.

@derobins derobins deleted the branch HDFGroup:1.10/master July 17, 2022 10:50
@derobins derobins closed this Jul 17, 2022
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.

None yet

3 participants