notmuch insert --keep fails in parallel w/ notmuch new

Subject: notmuch insert --keep fails in parallel w/ notmuch new

Date: Sun, 24 Jan 2016 16:48:00 +0100

To: Notmuch Mail

Cc:

From: Maarten Aertsen


Hello list,

I'd like to report a bug against notmuch 0.21, packaged for Debian 
jessie-backports as 0.21-3~bpo8+1.

# Steps to reproduce:
  1. start a notmuch new mail w/ lots of stuff to process (e.g. a 
     migration)
  2. try notmuch insert --keep

# Expected result:
Given the current text in the manpage, I'd expect notmuch insert --keep 
to save the message to the Maildir even if no db interaction is possible:

"--keep Keep the message file if indexing fails, and keep the message 
	indexed if applying tags or maildir flag synchronization fails.  
	Ignore these  errors and return exit status 0 to indicate 
        succesful mail delivery."

That way, I can cron notmuch new to pick up the occasional message that 
can't get indexed right away.

# Actual result:
notmuch insert --keep fails with exit code 1 due to the inability to get 
db access.

# Context:
I've switched to a setup with postfix, where notmuch insert --keep is 
called by /local/, postfix's local delivery daemon, via a pipe in 
.forward. Local treats a non-zero exit code as a 5.3.x status code and 
sends a bounce to the sender.

I had a short chat with j4ni on #notmuch, where he said:
< j4ni> Sagi: oh bummer, we try to open the db first, and bail out 
early. we should change the order of that (at least with --keep).

Thanks for developing notmuch.

best regards, Maarten Aertsen

Thread: