Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id CD38B431FB6 for ; Thu, 27 Jan 2011 10:20:08 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y9Y3EzVy0zjl for ; Thu, 27 Jan 2011 10:20:08 -0800 (PST) Received: from smtprelay04.ispgateway.de (smtprelay04.ispgateway.de [80.67.31.32]) by olra.theworths.org (Postfix) with ESMTP id DAE3A431FB5 for ; Thu, 27 Jan 2011 10:20:07 -0800 (PST) Received: from [87.180.40.233] (helo=stokes.schwinge.homeip.net) by smtprelay04.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1PiWRy-00068u-Hq for notmuch@notmuchmail.org; Thu, 27 Jan 2011 19:20:06 +0100 Received: (qmail 8335 invoked from network); 27 Jan 2011 18:20:04 -0000 Received: from kepler.schwinge.homeip.net (192.168.111.7) by stokes.schwinge.homeip.net with QMQP; 27 Jan 2011 18:20:04 -0000 Received: (nullmailer pid 12761 invoked by uid 1000); Thu, 27 Jan 2011 18:20:04 -0000 From: Thomas Schwinge To: notmuch@notmuchmail.org Subject: notmuch's idea of concurrency / failing an invocation User-Agent: Notmuch/0.5-33-g665f77b (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Thu, 27 Jan 2011 19:20:00 +0100 Message-ID: <87fwsetdin.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Df-Sender: thomas@schwinge.name X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Thu, 27 Jan 2011 18:20:08 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hallo! Stepping away from the current code base -- what is notmuch's original idea of concurrency? That is, all of us probably know that one: A Xapian exception occurred opening database: Unable to get write lock on /home/thomas/Mail-schwinge.name-thomas/.notmuch/xapian: already locked I recently saw that one while using the Emacs UI (that one tried to remove a unread tag or similar), and in parallel a delivery to the notmuch DB was going on. Apparently the DB we're using doesn't allow for simultaneous writing (even though it can't even possibly have been dangerous in this case). Which is the original idea here? Is it that... * each and every client should catch these kinds of errors, and retry, or eventually give up at some point, and report the status to the user; or is it that... * notmuch internally should catch these concurrency cases, and retry, or eventually give up at some point (``notmuch --maximum-wait=3D30s tag [...]''), and fail as seen above? This one is an obvious temporary error due to a concurrency situation. Wouldn't the latter suggestion be preferable here? I guess that in most cases the DB isn't locked for long periods of time, and thus the concurrency situation would decline quickly. One difficulty I see is judging which errors are temporary and which are permanent -- which is obvious in a lot of cases (concurrent DB access, memory starved or any other OS resource), but may not be, for example in case of I/O errors (is ``disk full'' a permanent error?). And then, for some of these cases, waiting does make sense (concurrent DB access, as suggested above), and for other (temporary?) errors it doesn't make (a lot of) sense (out of memory: only sensible thing is to abort, and have the caller re-try, or disk full: waiting for some free space may be worth it, or it may be not). Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk1Bt1AACgkQFaWaPJ2HwArMKgCffq8V1+LF0cPw3Dnz6Mx1UkUg WuoAn08aUGKARifFx6GChSRpE/LtJlJj =xutB -----END PGP SIGNATURE----- --=-=-=--