unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@mit.edu>
To: Michal Sojka <sojkam1@fel.cvut.cz>
Cc: notmuch@notmuchmail.org
Subject: Re: Xapian locking errors with custom query parser
Date: Fri, 28 Jan 2011 21:26:03 -0500	[thread overview]
Message-ID: <AANLkTinPph9Lj8h3UztQ74qMaaBVKkXB0rbiLeTX2GmW@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinW_n+zMtLC-fy=naUGsAiFDwdd-mAqSWEDvF=W@mail.gmail.com>

Looks like I managed to remove the line that deletes (and thus closes
and unlocks) the Xapian::Database object in a bout of overzealous code
removal.  The consequence was exactly what you suspected; there was a
brief window after notmuch had exited before the database actually got
unlocked.  Here's the fix.  cworth, what's the most convenient way for
me to slip this in to the patch series?

diff --git a/lib/database.cc b/lib/database.cc
index 7253bdf..3c488a9 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -826,6 +826,7 @@ notmuch_database_close (notmuch_database_t *notmuch)
     }

     delete notmuch->term_gen;
+    delete notmuch->xapian_db;
     talloc_free (notmuch);
 }


On Fri, Jan 28, 2011 at 11:35 AM, Austin Clements <amdragon@mit.edu> wrote:
> This should most definitely not happen.  I'll look in to it.
>
> On Fri, Jan 28, 2011 at 5:18 AM, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
>>
>> Hi Austin,
>>
>> when I switched to using your custom query parser I started experiencing
>> "Unable to get write lock" errors when I run my initial tagging script.
>> I thought that this was because I run the script while processing the
>> mail in Emacs, but today I realized that this happens even without Emacs
>> and that it can be reproduced by a simple command below.
>>
>> i=0; while notmuch tag +xxx tag:whatever; do i=$((i+1)); echo $i; done
>>
>> It seems that sometimes the unlocking of the Xapian database happens
>> somewhat lazily and when the subsequent command starts I get:
>>
>> A Xapian exception occurred opening database: Unable to get write lock on
>> /home/wsh/mail/.notmuch/xapian: already locked
>>
>> This happens almost regularly after a few iterations of the loop even if
>> the query doesn't match anything.
>>
>> Do you have an idea what may cause this?
>>
>> Can you reproduce this on your system?
>>
>> The version I use can be obtained from
>>
>>  git://rtime.felk.cvut.cz/notmuch.git custom-query-pasrser
>>
>> Thanks
>> -Michal
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch
>
>

  reply	other threads:[~2011-01-29  2:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28 10:18 Xapian locking errors with custom query parser Michal Sojka
2011-01-28 16:35 ` Austin Clements
2011-01-29  2:26   ` Austin Clements [this message]
2011-03-11  2:21     ` Carl Worth
2011-03-11  2:47       ` Austin Clements
2011-03-11  5:26         ` Carl Worth
2011-03-11  8:58           ` Michal Sojka
2011-03-21  7:51             ` Austin Clements
2011-03-24 13:50               ` Date ranges syntax (was: Xapian locking errors with custom query parser) Michal Sojka
2011-03-21  7:41           ` Xapian locking errors with custom query parser Austin Clements
2011-03-11  2:55       ` Jameson Rollins

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=AANLkTinPph9Lj8h3UztQ74qMaaBVKkXB0rbiLeTX2GmW@mail.gmail.com \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    --cc=sojkam1@fel.cvut.cz \
    /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).