Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 3c / 630faf4f61dfd4c29e9a042e49e3d4febdd739
1 Return-Path: <marmstrong@google.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id 614A16DE00BD\r
6  for <notmuch@notmuchmail.org>; Tue,  2 Aug 2016 08:26:54 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.924\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.924 tagged_above=-999 required=5 tests=[AWL=0.098,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.211, SPF_PASS=-0.001,\r
14  T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id kCwxpYkKRXiE for <notmuch@notmuchmail.org>;\r
18  Tue,  2 Aug 2016 08:26:46 -0700 (PDT)\r
19 Received: from mail-pf0-f172.google.com (mail-pf0-f172.google.com\r
20  [209.85.192.172])\r
21  by arlo.cworth.org (Postfix) with ESMTPS id A65856DE00B8\r
22  for <notmuch@notmuchmail.org>; Tue,  2 Aug 2016 08:26:46 -0700 (PDT)\r
23 Received: by mail-pf0-f172.google.com with SMTP id h186so67298282pfg.3\r
24  for <notmuch@notmuchmail.org>; Tue, 02 Aug 2016 08:26:46 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\r
26  s=20120113; h=from:to:subject:user-agent:date:message-id:mime-version;\r
27  bh=ffRJGbD5vRd7RuYrRx7W82o+QEU4NMc1xAvYrFV93qQ=;\r
28  b=PSR8Ok7Kkb68Pq8N232rXqEyY04XaZEmaumHaHDiXRbvhPeksrPF2QYtpIiibShYR4\r
29  LzzsTmmy5hc7DYpwgQk/ya3bYe1oQSwbt1qjs9u06Sa5S1WwFQZiNe0z45jTfsoPkPno\r
30  H1gHzY6H9twsCeWKpbkoKUU2EPMierUPRaXtIjSQ9R+eqHVc6PlWxo+2+xpQN3obiEog\r
31  r+cqD9ah6ZnBdEJDMHBpC5zTabCpU8lKLGoFUT6Ua6IV8SsIuNXTQdvKcm0+a7fQHT+M\r
32  LK5PiLlFidrufFzzn4p828IUU+J2o2FnCa4C28rigHx+py8pC+IzjTS6TKp60Cp78gXJ gIfA==\r
33 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
34  d=1e100.net; s=20130820;\r
35  h=x-gm-message-state:from:to:subject:user-agent:date:message-id\r
36  :mime-version;\r
37  bh=ffRJGbD5vRd7RuYrRx7W82o+QEU4NMc1xAvYrFV93qQ=;\r
38  b=AYpTdK9MFyxOjFf51AHRmLF+Kikrmlnu3TvQjAsMvgLB65VPvELQ99GtSsyvFCrX4l\r
39  zkO5YGtWD+adoElyC29+AjNRja+HbsdI0T6lssi7JCA7pXAZ3WlbSDB52cwNwcTca1LW\r
40  FkLECq90ZYXfZLJctMT8xtOQ32DcccaWnExmYxXTiwUBi+Yas2KzyVUYtIiNmfSUtXBQ\r
41  vJXXK+ucJ1KIAGBt4Ed1GGvT/S7EgPke8QcVrm1oo8R36uFveeUtlGh8QbVfJ6qHqJov\r
42  r8UI8nqg+7bmjFJWM9ngLMMZaftZMCPFwtDKdQ1FKBxyh6Rv6FjILujAVCE8CcCFm+l+\r
43  GGYw==\r
44 X-Gm-Message-State:\r
45  AEkooutuhwv4MOUdqvrR2wMWBNbjx7lYXJP5GhWemalsXVtD9VhD22M+uuQE1GWeZGWnF3At\r
46 X-Received: by 10.98.89.23 with SMTP id n23mr106972651pfb.34.1470151605729;\r
47  Tue, 02 Aug 2016 08:26:45 -0700 (PDT)\r
48 Received: from marmstrong-linux.kir.corp.google.com\r
49  ([2620:0:1008:1101:419b:e62d:4938:a6b6])\r
50  by smtp.gmail.com with ESMTPSA id x66sm5700831pfb.86.2016.08.02.08.26.44\r
51  for <notmuch@notmuchmail.org>\r
52  (version=TLS1_2 cipher=AES128-SHA bits=128/128);\r
53  Tue, 02 Aug 2016 08:26:44 -0700 (PDT)\r
54 From: Matt Armstrong <marmstrong@google.com>\r
55 To: notmuch@notmuchmail.org\r
56 Subject: A systematic way of handling Xapian lock errors?\r
57 User-Agent: Notmuch/0.21 (https://notmuchmail.org) Emacs/24.3.1\r
58  (x86_64-pc-linux-gnu)\r
59 Date: Tue, 02 Aug 2016 08:26:43 -0700\r
60 Message-ID: <qf5d1lrkx8s.fsf@marmstrong-linux.kir.corp.google.com>\r
61 MIME-Version: 1.0\r
62 Content-Type: text/plain\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.20\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67  <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
69  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
74  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Tue, 02 Aug 2016 15:26:54 -0000\r
76 \r
77 Simple notmuch commands like "notmuch tag" can fail to grab the Xapian\r
78 lock.  When this occurs they bail with:\r
79 \r
80 A Xapian exception occurred opening database: Unable to get write lock on /example/.notmuch/xapian: already locked\r
81 \r
82 I've noticed a few issues with this:\r
83 \r
84 1) The notmuch command line doesn't define semantics for exit codes.  I\r
85 notice that notmuch exits with 1 for "xapian write lock error".  I\r
86 suspect this code is not reserved for write lock errors?  That would be\r
87 needed for any sensible downgrade of the write lock error into a soft\r
88 failure with a retry loop in things like shell scripts.\r
89 \r
90 2) The notmuch Emacs client just bails whatever it was trying when this\r
91 occurs.  I run background mail fetching, which I expect is typical, and\r
92 this makes for an unpleasant experience as errors are thrown at me\r
93 randomly.  Since my post-injection filter commands run quickly, I'd\r
94 rather Emacs simply spin a short while against the lock trying to\r
95 perform the command.  Even a one second spin attempt is likely to\r
96 succeed most of the time.  But I would happily configure an infinite\r
97 retry loop -- Emacs can show me a spinning ball, and I'd rather not be\r
98 subject to odd effects due to failures.\r
99 \r
100 To address both, has something like this ever been considered:\r
101 \r
102   notmuch --lock_timeout <seconds> COMMAND ARG...\r
103 \r
104 Then frontends like Emacs could lean on retry logic written in C.  If\r
105 this seems workable, it is something I can try implementing.\r