-
Notifications
You must be signed in to change notification settings - Fork 73
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.gui.hdf5 and HDF5_USE_FILE_LOCKING #4071
Comments
Since this was working with silx 1.1.2, it sounds to be a regression in silx v2. Did you change any other package when switching from silx v1 to v2? Are the HDF5 files you access being otherwise opened for writing or reading?
We try to support HDF5's file locking disabled. We even provide some helpers for accessing HDF5 files being written. We are relying on this for online data access (though my personal opinion is that it is not a good idea since we keep facing issues). In silx view, we do the same "workaround" as you do: set HDF5_USE_FILE_LOCKING before anything imports h5py silx/src/silx/app/view/main.py Line 123 in 0abd43e
It's been working fine even with changes in libhdf5 related to file locking. The issue is that you should not write files without locking because they can get corrupted if another application is opening them. |
Hi,
No. I've now checked it again on Python 3.11.6: after uninstalling silx and
And here after commenting out
all external links are still alive. After upgrading silx to 2.0.0, h5py.version.hdf5_version is still '1.14.2'. And all external links are broken.
restores the links.
No, these are offline data files, accessed only by silx.gui.hdf5.Hdf5TreeModel. |
I tried to find out the cause, and nothing changed in Could you try to browse the same files with The If this reproduce the error, could you provide us the file? I couldn't reproduce with dummy files with external links |
This change is related to file locking: https://github.com/silx-kit/silx/pull/3939/files#diff-f7305bec0300313b03a14fece7a1e78cdcb4994f086ee18eb467567d212cfc38 Could you provide a way to reproduce the issue with parseq so I can investigate? |
Yes! The error is gone after having this change reverted. |
Thank you for agreeing to investigate!
|
Thanks for the easy way to reproduce! This is indeed related to #3939 and to an issue we recently found in libhdf5/h5py regarding file locking and external links: https://forum.hdfgroup.org/t/external-link-and-file-locking-disabled-issue/12012: External links do not inherit file locking from the file linking them (and file locking is enabled by default) and you cannot open a file twice with different file locking in the same process. I'm still not sure what's the best way out of this at silx level until this is fixed in libhdf5/h5py. attn @woutdenolf |
Simple way to reproduce with
|
Thanks for the testing! |
Hello,
The latest version of silx has broken my application (ParSeq) where I join together QFileSystemModel with silx.gui.hdf5.Hdf5TreeModel. All external links are seen as faulty tree nodes. I see this new behaviour with silx 2.0.0 but not with 1.1.2 on the same Python 3.11.6. I cannot confirm the change on Python 3.12.2 because the older silx 1.1.2 is not installable there.
The reason is in line 184 of silx.gui.hdf5.Hdf5Item.py where
parent_obj.get(self.__key)
returns None for external links. One may say this is an h5py problem, but its version is the same (3.10.0) when I compare silx 2.0.0 with silx 1.1.2.The workaround I have found is to do
before the import of silx.gui.hdf5. If I also import hdf5plugin before importing silx, I have to do hdf5 file unlocking before importing hdf5plugin. And if I directly use h5py, I also have to do this beforehand.
Question
What is the silx developers’ view on hdf5 file locking and on its interaction with silx.gui.hdf5, hdf5plugin and h5py? Is it "not silx's business"?
Thank you!
The text was updated successfully, but these errors were encountered: