Single Writer Multiple Reader (SWMR) support?
While writing to my hdf5 file with swmr_mode on, I tried to open the hdf5 file with the extension, but I got the error Request failed with status code 500 on the frontend and OSError: Unable to synchronously open file on the backend.
Example can be found on https://docs.h5py.org/en/stable/swmr.html#using-the-swmr-feature-from-h5py
If we add the option "swmr": True to https://github.com/silx-kit/jupyterlab-h5web/blob/d926bac95786c1bf86dca4cdbf64a1c111b7a993/jupyterlab_h5web/handlers.py#L44
it can enable the swmr feature for the extension.
Thanks for the report. I think it makes sense to add support for SWMR but if possible, I'd like to make this a setting of the extension.
We had some troubles in the past with SWMR so I would prefer to not enable it for all users.
A quick search shows me there is a tutorial for front-end settings but I didn't find anything about backend settings. I am sure it must exist though.
A PR is welcomed, else I will do a more thorough search later to see how to do it.
One issue is that the SWMR mode requires HDF5>=v110, so I don't think you can open files created with older versions of the HDF5 library with swmr=True (needs to be tested). However it should be possible to catch the exception raised when trying to open a file that is already opened in SWMR mode and retry opening it with swmr=True.
Another limitation is that the h5web viewer caches the data, so AFAIK, updates of the HDF5 file will not be taken into account by the viewer once the data has been loaded.
@t20100 has confirmed that opening a file that was created with HDF5 1.8 in SWMR read mode works perfectly fine in various scenarios. So it should be fine to always open files with swmr=True in jupyterlab_h5web.