dosyago / dn

💾 dn - offline full-text search and archiving for your Chromium-based browser.
https://localhost:22120
Other
3.78k stars 145 forks source link

Bring down changes from upstream that may address the clubbering of index Jason #130

Closed o0101 closed 1 year ago

o0101 commented 2 years ago

The reason that index Json is wiped out sometimes may be related to the fact that during shutdown on during a memory error when we are writing the index Jason they may be some race condition where a second right is cold after the in-memory object that's written to disk is already emptied. This might happen because we have multiple cleanup functions that execute possibly multiple times on shutdown. It may not be this cause cuz this bug is being hard to reproduce but the changes that I'm bringing down from upstream consist of unifying the cleanup functions and performing a check that we are not writing an empty object this may not solve the issue but it also make us some way to address it or it may completely solve it. In any case it's more solid to have a cleanup function like this so I'm bringing the changes down.

o0101 commented 1 year ago

Should be done now.