Uh oh!
There was an error while loading. Please reload this page.
data wiped from MemoryStore after store.close + array[:] - #2067
Conversation
d-v-b
commented
Aug 6, 2024
so i figured out where this is coming from. i'm not sure if it's a bug or not.
ifnotself._is_open:
awaitself._open()
I don't fully understand the open / closed semantics here. My intuition is that re-opening a closed store feels weird, and having the @brokkoli71 what's the logic for invoking |
tests are now passing with this PR. Instead of conditionally calling I think we should not merge this until we have a conversation about the store design. I would really like to be able to create store classes in synchronous code without needing @jhamman and @normanrz any thoughts about this issue (i.e., that we cannot fully initialize a store class in synchronous code without |
dcherian
commented
Aug 6, 2024
So is the bug here thati was reusing the array object I wrote to? But instead I should create a new one? |
d-v-b
commented
Aug 6, 2024
The bug was that the store class self-destructs if a) it was created with |
| if not self._is_open: | ||
| await self._open() | ||
| raise RuntimeError("Store is closed. Cannot `get` from a closed store.") |
There was a problem hiding this comment.
turn this into self._check_open() like self._check_writable()
There was a problem hiding this comment.
also, should we propagate this to all other stores?
There was a problem hiding this comment.
both good ideas! the fact that tests passed without me making the last change means we need more tests for this
In this example the mode was explicitly set to Furthermore, the examples in the docstrings of array.py suggest using The other problem with implicitly opening a store is a problem, too. I agree with the comments above. Edit: I think it make sense here to fallback to |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hannes Spitz <44113112+brokkoli71@users.noreply.github.com>
brokkoli71
commented
Aug 12, 2024
I had a similar thought process while working on #2000. On the one hand |
…nto indexing-after-close
d-v-b
commented
Oct 11, 2024
@TomAugspurger do you have any ideas for how we could address this cleanly? for background, I am not happy with the solution I am pursuing in this PR, so we shouldn't give that much weight |
TomAugspurger
commented
Oct 11, 2024
I don't have a strong opinion after thinking through this for a bit, but here's something: I wonder if we have two different kinds of "opening" (and closing) going on here:
IMO, the logical stuff should just happen the very first time a store is created using The resource-level stuff can happen whenever I think (perhaps with APIs for users to control). This is all assuming that the Stores are created with |
jhamman
commented
Nov 13, 2024
d-v-b
commented
Nov 13, 2024
i agree! |
Over in #1746@dcherian discovered the following bug:
Setting data with
a[:] = nparray, followed bya.store_path.store.close(), followed bya[:], results in the store getting wiped. This is not intended behavior.this PR adds:
TODO:
Closes#2067