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

silx.io.h5py_utils: Fixed support of libhdf5 v1.14.4 #4177

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

t20100
Copy link
Member

@t20100 t20100 commented Oct 1, 2024

Checklist:


This PR keeps locking=None instead of forcing it to True when checking if it can disable it so that it uses libhdf5 default locking mode (either best-effort - the default - or True - which can be set as default at compile time...).

libhdf5 v1.14.4 (that comes in h5py v3.12.1 wheel) fixed an issue with retrieving the file locking information from opened files in order to fix the opening of external links (that was not respecting the file locking).
It seems that beforehand, the compatibility of the ignore locking errors (the difference between locking=True and locking="best-effort") was not tested when opening already opened files while it is tested now.

See https://github.com/HDFGroup/hdf5/blob/57948148dbcb275c9a39212eebc62e071b11a00d/release_docs/RELEASE.txt#L917-L940

It also adds typing on the modified functions.

@t20100 t20100 added the question label Oct 1, 2024
@t20100 t20100 changed the title silx.io.h5py_utils: Fixed support oflibhdf5 v1.14.4 silx.io.h5py_utils: Fixed support of libhdf5 v1.14.4 Oct 1, 2024
Comment on lines +105 to +106
if locking is None and mode == "r" and not swmr:
locking = False
Copy link
Member Author

Choose a reason for hiding this comment

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

That's the main change: keep None or set to False

if not locking:
if locking is None and mode == "r" and not swmr:
locking = False
if locking in (False, "false"):
Copy link
Member Author

Choose a reason for hiding this comment

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

This is to accomodate all possible values of h5py.File's locking:

locking – The file locking behavior. One of:
False (or “false”) – Disable file locking
True (or “true”) – Enable file locking
”best-effort” – Enable file locking but ignore some errors
None – Use HDF5 defaults

I left the former way to disable locking with HDF5_USE_FILE_LCOKING env. var. as it is, so it only supports True, False, None.

@t20100 t20100 removed the question label Oct 4, 2024
@t20100 t20100 added this to the Next release milestone Oct 7, 2024
src/silx/io/h5py_utils.py Outdated Show resolved Hide resolved
src/silx/io/h5py_utils.py Outdated Show resolved Hide resolved
@t20100 t20100 merged commit fad7561 into silx-kit:main Oct 8, 2024
6 of 10 checks passed
@t20100 t20100 deleted the fix-hdf5-1.14.4-support branch October 8, 2024 08:55
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