Skip to content
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

Improve durability of maildir-in-zip storage #17

Open
BjarniRunar opened this issue Oct 1, 2024 · 0 comments
Open

Improve durability of maildir-in-zip storage #17

BjarniRunar opened this issue Oct 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@BjarniRunar
Copy link
Member

Moggie's main storage format is supposed to be Maildir in an (optionally encrypted) ZIP archive.

I am currently using a fork of pyzipper (see danifus/pyzipper#34 ) for that, it works pretty well under normal operations.

However, I've discovered that if I hard-kill the moggie process while it is in the process of updating the archive, the archive may be left in a state where it has no table-of-contents entry written out and the contents become unusable, effectively lost. For the app's primary storage format, this is an unacceptable bug.

This is a reminder to myself to address this somehow. A few potential ideas:

  • Review how signal handling is done in the code responsible for updating the archives, make sure we shut down cleanly as often as possible (a moggie change)
  • Always write out a TOC along with every file added (pyzipper)
  • Keep older TOCs around (some of the time) and add logic to rediscover them (pyzipper)
  • Make sure pyzipper knows how to rebuild the table of contents by scanning the archive, and make sure it does so when necessary (pyzipper)

The last of these might be the best option, I think there was already some logic present to do this sort of thing.

@BjarniRunar BjarniRunar added the bug Something isn't working label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant