From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B8D646DE0159 for ; Fri, 4 Nov 2016 09:26:22 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.006 X-Spam-Level: X-Spam-Status: No, score=-0.006 tagged_above=-999 required=5 tests=[AWL=0.005, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id szfVY_wZRLaE for ; Fri, 4 Nov 2016 09:26:22 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 3C4846DE00D3 for ; Fri, 4 Nov 2016 09:26:22 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1c2hJa-0003wG-Fx; Fri, 04 Nov 2016 12:26:02 -0400 Received: (nullmailer pid 13422 invoked by uid 1000); Fri, 04 Nov 2016 16:26:17 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: Paul Wise , 843127@bugs.debian.org Subject: Re: [Paul Wise] Bug#843127: notmuch: race condition in `notmuch new`? In-Reply-To: <87a8dfl8em.fsf@tesseract.cs.unb.ca> References: <87a8dfl8em.fsf@tesseract.cs.unb.ca> Date: Fri, 04 Nov 2016 13:26:17 -0300 Message-ID: <87a8df9pp2.fsf@tesseract.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2016 16:26:22 -0000 Paul Wise wrote: > Last night I got this error=C2=A0from my `notmuch new --quiet` cron job. = The > file that the error message complains about is now in the cur directory > of the maildir at the following path. > > /path/to/mail/cur/1478190211.H80553P18378.chianamo:2, > > I wonder if this some kind of race condition in `notmuch new` processing. > Perhaps it should be using inotify to find out about file movements? > > Unexpected error with file /path/to/mail/new/1478190211.H80553P18378.chia= namo > add_file: Something went wrong trying to read or write a file > Error opening /path/to/mail/new/1478190211.H80553P18378.chianamo: No such= file or directory > Note: A fatal error was encountered: Something went wrong trying to read = or write a file I agree it looks like a race condition. inotify sounds a bit overcomplicated and perhaps non-portable? It should probably just tolerate disappearing files better, consider that a warning. As a workaround, if you can replace background use of notmuch-new with notmuch-insert (and I understand this doesn't work for everyone), you will eliminate this kind of race condition. d