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,


From: David Bremner

Matthew Lear <> 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 <>
> 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

notmuch mailing list --
To unsubscribe send an email to