fix(array): make docarrays persist atexit#604
fix(array): make docarrays persist atexit#604Jackmin801 wants to merge 2 commits intodocarray:mainfrom
Conversation
|
Of the new tests added, 1 of them is expected to fail. DocArrays backed by Weaviate seem to have 2 references to them upon creation. |
|
Hey @Jackmin801 , please solve the commit linting problem to have the |
|
Ah ok. I purposely failed it cause I wasnt sure if I should be constantly running the CI. Seems like they are a bit expensive |
6d60ce4 to
f9fcba4
Compare
Before this, they would try to persist at SystemExit which is error prone
Codecov Report
@@ Coverage Diff @@
## main #604 +/- ##
==========================================
- Coverage 84.91% 75.72% -9.19%
==========================================
Files 133 133
Lines 6714 6723 +9
==========================================
- Hits 5701 5091 -610
- Misses 1013 1632 +619
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
for this logic, we will be update offset2id twice if we use the context manager.
What I propose is:
- rename _delete to _synced
- _synced is initially true
- _synced = False on append/extend/update/delete operations
- _synced = True when context manager exits
I also think it's clearer to put just _save_offset2id (or any logic that cannot run during program exit) in the exit hook, not all of del.
@JoanFM what do you think ?
I like this idea |
|
After some discussion internally among the maintainers, it was decided DocArray will only support explicit sync and sync when exiting context manager. There are four candidate places we can sync:
DocArray will only support (1) and (2) -- explicit sync and sync when exiting context manager. We will not support syncing when the variable gets garbage collected or when the program exits.
|
|
We are no longer pursuing adding the behavior of persistence to atexit. The intended persistence behavior will be implemented in #625 |
Goals:
ModuleNotFoundErrorwhen using elasticsearch as storage backend #529