unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: Maarten Aertsen <sagi-notmuch@rtsn.nl>, notmuch@notmuchmail.org
Subject: Re: notmuch dump: taking write-lock to protect from concurrent (cronned) notmuch new?
Date: Fri, 06 Jun 2014 12:46:27 +0100	[thread overview]
Message-ID: <878upafegc.fsf@qmul.ac.uk> (raw)
In-Reply-To: <20140606080354.28047.77393@kardo.rtsn.nl>


On Fri, 06 Jun 2014, Maarten Aertsen <sagi-notmuch@rtsn.nl> wrote:
> Hi everyone,
>
> (summary of IRC-conversation just now)
> I did:
>   - run notmuch new (and afew -t) in cron, every two minutes
>   - run notmuch dump in cron, every 12 hours
>
> I expected:
>   - notmuch dump to complete, possibly causing notmuch new to fail in the meantime
>
> I observed:
>   - notmuch dump terminating with:
> "terminate called after throwing an instance of 'Xapian::DatabaseModifiedError'"
>
> mjw1009 suggested to change NOTMUCH_DATABASE_MODE_READ_ONLY on line
> 215 of notmuch-dump.c to NOTMUCH_DATABASE_MODE_READ_WRITE
>
> I'm wondering if this hits enough people to motivate the addition of a
> command line switch (or perhaps even a change in default behaviour?)

I think this is a clear bug but the fix is a little unclear. The above
fix works but it breaks one of the tests: "unicode message-ids" in
T150-tagging.sh.

I think the problem is that it does 
notmuch dump | sed... | notmuch restore

and if we open the dump read-write the restore will fail.

We can obviously fix the test, but I don't know if anyone is using a
pipe of this sort in their scripts. If this a likely problem then we
could offer a --no-lock option (which keeps the behaviour as now)

What do people think?

Best wishes

Mark

  reply	other threads:[~2014-06-06 11:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06  8:03 notmuch dump: taking write-lock to protect from concurrent (cronned) notmuch new? Maarten Aertsen
2014-06-06 11:46 ` Mark Walters [this message]
2014-06-12 22:56   ` David Bremner
2014-06-12 23:21     ` Mark Walters
2014-06-23 20:12       ` [PATCH] dump: make dump take Xapian write lock Mark Walters
2014-07-15 14:10         ` David Bremner
2014-07-16  6:50           ` Mark Walters
2014-07-16 22:36         ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878upafegc.fsf@qmul.ac.uk \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=sagi-notmuch@rtsn.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).