Lost updates to Notmuch database

Eric J eric at deptj.eu
Thu Feb 18 04:59:28 PST 2016


On Wed, 17 Feb 2016 21:03:13 -0400, David Bremner <david at tethera.net> wrote:
> Eric J <eric at deptj.eu> writes:
> 
> > 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.
> 
> It should be impossible for more than one process to open a Xapian
> database for writing at the same time. So if the processes are really
> running in parallel, you should be getting error codes from the later
> calls to notmuch_database_open{_verbose}. You claim that's not
> happening, which is puzzling. Maybe you can try to duplicate your
> problem with a tiny C program.

Thanks David. Impossible? - yes, but if I do just the open in two
interactive sessions (the Tcl interface makes this easy), I get the
following from "lsof flintlock":

COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
cat     21408 eric    5w   REG    8,9        0 667773 flintlock
cat     21418 eric    5w   REG    8,9        0 667773 flintlock

So, open for writing, but not locked (the processes have the right
parents).

I managed to catch a run of "notmuch new" with "lsof -r5 flintlock":

COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
cat     20763 eric    3ww  REG    8,9        0 667773 flintlock

which is open for writing and (partially) locked, so it must be doing
something that I'm not. I obviously need to go carefully through the
code to see what that is (and experiment in C if I can't find it!).

I don't have the _verbose functions BTW, still on 0.18.1 - I thought I
would get a proof-of-concept before upgrading notmuch, but...

Thanks again,

Eric
-- 
ms fnd in a lbry


More information about the notmuch mailing list