Notmuch backend: impossible to have two "accounts" #52
Labels
No Label
IMAP
JMAP
Maildir
Retired
User Experience
User Interface
bsd
bug
contacts
currently worked on
documentation
duplicate
easy
enhancement
help wanted
invalid
linux-gnu
macos
mbox
notmuch
question
security
wishlist
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: meli/meli#52
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Hi!
I use the following setup: two mail accounts under the same directory and a single
notmuch
database to handle them both:I'm currently using
alot
as notmuch-based mail client, where I can split the view following accounts, I triedaerc
where I can do it as well (differents accounts with different queries).I wanted to try
meli
too, it looks great, readable, easily configurable. However, I can't have two separated accounts using notmuch backend. Here is my configuration:When running
meli
, nothing append. No error, no interface, only my command and a cursor that seems to wait for something. I can only cancel with<C-c>
.If I comment one account or another it works fine, but once I set two accounts, it breaks.
More information:
aur/meli-git
and also tried from the sources (both on versionmeli 0.5.1
);$ RUST_BACKTRACE=1 cargo run
does not give more information (there is no error after all);$ meli --test-config "$XDG_CONFIG_HOME"/meli/config.toml
returns no output.Hello, thank you so much for your bug report! It seems meli doesn't take notmuch locking into account. The obvious solution here is to not take a write lock when initializing an account and acquire locks only when needed instead of holding them.
I will try to push a fix asap.
It seems you know what's blocking here, nice!
It is not obvious to me. Just for my own culture, could you explain what is the blocking part?
I'm not an accomplished developer but I know Python and I'm slowly, quietly learning Rust (this is what brought me to project like meli).
Sure. In this line the notmuch database is opened with a write lock. The lock is held for as long as meli runs. So when the second account gets initialized, it requests another write lock on the database and blocks. In retrospect it seems like a big overlook. I'm looking at what needs to be changed right now. The general approach will be to hold the lock for short lived durations.
Ok, so as I understand, it is for the same reason that I can't run 2 meli instances in parallel (at least with notmuch settings).
Ok, this should be fixed by
2230e5705d
Yes, yes :) It should work now.
I confirm!
So now I can continue digging into meli. Seems promizing to me :)
Thanks for your responsiveness and your explainations!