unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Lost updates to Notmuch database
@ 2016-02-17 20:44 Eric J
  2016-02-18  1:03 ` David Bremner
  2016-02-21 12:57 ` Eric J
  0 siblings, 2 replies; 7+ messages in thread
From: Eric J @ 2016-02-17 20:44 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-02-27 20:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 20:44 Lost updates to Notmuch database Eric J
2016-02-18  1:03 ` 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

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).