unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Eric J <eric@deptj.eu>
To: notmuch@notmuchmail.org
Subject: Lost updates to Notmuch database
Date: Wed, 17 Feb 2016 21:44:23 +0100 (CET)	[thread overview]
Message-ID: <337393ce5e2484d64f837a44b2c4f2ea32f91295-NM@bruno.deptj.eu> (raw)

Using the API, I am adding single mail files, already in the maildir, to
the Notmuch database and tagging them. It works, every time, as long as
I run it one file at a time. 

However, if I do it twice, in different processes, at the same time, one
file is added and tagged properly, the other is not (totally unfindable
by notmuch search). Neither process reports any error, and they both log
their actions normally. Actually a third simultaneous process also fails
to leave any result in the database.

This is in spite of using begin_atomic/end_atomic. I would not have been
surprised to get Xapian lock errors, but the database_open returns
success, as does the database_begin_atomic. 

The wrapper around the API for Tcl is very simple, and I can not see any
way for that or Tcl itself to cause this sort of problem. Beyond this,
I haven't thought of any way to decide if this could be a Notmuch problem
or a Xapian problem.

The API sequence is:

    database_open
    database_begin_atomic
    database_add_message
    (next 4 are a for loop)
    message_get_tags
    tags_valid
    tags_move_to_next
    tags_get
    message_freeze
    message_add_tag
    message_thaw
    message_maildir_flags_to_tags
    message_get_filename
    message_get_message_id
    database_end_atomic
    message_destroy
    database_close
    database_destroy

I didn't realise till it was mostly written, but it is pretty much like
add_new() in notmuch-new.c .

Eric
-- 
ms fnd in a lbry

             reply	other threads:[~2016-02-17 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 20:44 Eric J [this message]
2016-02-18  1:03 ` Lost updates to Notmuch database David Bremner
2016-02-18 12:59   ` Eric J
2016-02-18 14:30   ` Tomi Ollila
2016-02-18 21:26     ` Eric J
2016-02-21 12:57 ` Eric J
2016-02-27 20:04   ` Eric J

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=337393ce5e2484d64f837a44b2c4f2ea32f91295-NM@bruno.deptj.eu \
    --to=eric@deptj.eu \
    --cc=notmuch@notmuchmail.org \
    /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).