-
Notifications
You must be signed in to change notification settings - Fork 520
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
Make file closing and get_obj_ids more robust #1854
Conversation
Preventing IDs from being dec_ref-ed to 0 between retrieving them and inc_ref-ing them. Closes h5pygh-1852
Codecov Report
@@ Coverage Diff @@
## master #1854 +/- ##
==========================================
- Coverage 88.40% 87.28% -1.13%
==========================================
Files 17 17
Lines 2285 2178 -107
==========================================
- Hits 2020 1901 -119
- Misses 265 277 +12
Continue to review full report at Codecov.
|
h5f.get_obj_ids
I can confirm that this also makes the issue go away for the other reproducers I'm aware of. |
Is there a rough timeline on when a version with this will be released? |
Sorry for the delay. Things seem to have gone quiet, which hopefully means 3.2.1 is working OK for most people. But I'll try to do a new release some time soon. I would like to:
|
This now contains two related changes.
First, temporarily disable garbage collection in
h5py.h5f.get_obj_ids
, so it can't invalidate HDF5 IDs between us retrieving them and callingH5Iinc_ref
to keep them alive. This fixes #1852.However,
get_obj_ids
is still a fairly awkward thing to call fromFile.close()
- it creates h5py ObjectID objects, which can cause problems at interpreter shutdown, and it increments HDF5 ref counts only to decrement them again. Now it also has to turn garbage collection off and on again. So I moved part of theFile.close
logic into aFileID._close_open_objects
method, which calls the autogenerated bindings directly and avoids these complexities. This fixes #1495.