-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add support for reopening files closed by cache eviction #8
Comments
Hello @estebanag, Yes, definitely. The lock is a good addition too, indeed things could go wrong with many threads. Regarding the automatic re-opening I'm not sure if the You could of course wrap the |
Great. Regarding recreating the |
There is a bug on line 149 of init.py. |
Actually, closing a file that is shared is a bad idea. Maybe this bug was a good thing. Perhaps the cache should use weak references and only close the file when the last reference is removed. |
Hi @Exteris,
Thanks for the work on this project. I've forked your repo (see here) and I'm in the process of experimenting with a way to automatically reopen
htpy.File
s (closed by cache eviction) when ah5py.Dataset
is requested. Also note that I've added a lock to synchronize access to the cache, as it may cause problems when using dask. The current code is just a quick test (that works) but would you be interested in having this functionality in a PR? Any ideas or preferences are welcome.@mrocklin, any feedback from you is also more than welcome!
The text was updated successfully, but these errors were encountered: