[notmuch] Queue updates to eliminate write-lock errors

micah micah at riseup.net
Sat Jan 2 10:16:12 PST 2010


I'm sure we are all seeing these occasionally:

notmuch-call-notmuch-process: A Xapian exception occurred opening database: Unable to get write lock on .... : already locked

It happens when you try to make a change while 'notmuch new' is being
run, which is regularly. Typically a 'notmuch new' process doesn't take
that long (especially if you are running the newer xapian libraries that
fix that bug), but I still find that I am getting that error fairly
regularly. It could be because I have a somewhat slow laptop, which has
limited memory, CPU and a slow disk, so these updates take longer so I
hit that race more frequently than others.

In any case, I am sure people have figured out the best way to deal with
this already, just the work has to be done, but in case it hasn't been
floated yet, what about a queueing layer that accepts interactive
changes and attempts to apply them to the backend, backing off and
retrying until it can get the xapian lock. That way we can merrily go
along and make changes without hitting this locking problem. These
changes might have a minor delay before they are applied (until the
queue has been flushed), but it would be the same amount of time that we
have to wait now, just without the write-lock error.

micah
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100102/538fe1ad/attachment.pgp>


More information about the notmuch mailing list