Re: Database locked when running hooks

Subject: Re: Database locked when running hooks

Date: Thu, 18 Mar 2021 07:55:50 -0300

To: Matthew Lear, notmuch@notmuchmail.org

Cc:

From: David Bremner


Matthew Lear <matt@bubblegen.co.uk> writes:
>
> The problem can be reproduced by creating $DATABASEDIR/.notmuch/hooks/pre-new and having it perform a notmuch CLI command to write to the DB, such as apply a tag.
>
> I described the problem in https://github.com/gauteh/lieer/issues/195 <https://github.com/gauteh/lieer/issues/195>
>
> Assuming the database should be able to be opened for writing in the context of the pre-new (and post-new) hooks, this seems like a bug.

Yes, this is a bug I introduced recently, thanks for bringing that to my
attention. It should be just the pre-new hook which is (incorrectly) run
while the database is locked, the post-new should continue to work as
before.  It should be fairly easy to fix, I just need to initially open
the database read only, then re-open it for read/write after running the
hook.

d
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: