From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.58.247.3 with SMTP id ya3csp568523vec; Mon, 3 Sep 2012 11:10:12 -0700 (PDT) Received: by 10.60.7.104 with SMTP id i8mr14310063oea.31.1346695812097; Mon, 03 Sep 2012 11:10:12 -0700 (PDT) Return-Path: Received: from rubyforge.org (50-56-192-79.static.cloud-ips.com. [50.56.192.79]) by mx.google.com with ESMTP id fy3si13745307obc.45.2012.09.03.11.10.11; Mon, 03 Sep 2012 11:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) client-ip=50.56.192.79; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 9F0F22E08F; Mon, 3 Sep 2012 18:10:11 +0000 (UTC) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by rubyforge.org (Postfix) with ESMTP id 76BA22E074 for ; Mon, 3 Sep 2012 18:10:00 +0000 (UTC) X-AuditID: 12074424-b7f856d000000942-b9-5044f2772e6f Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 54.77.02370.772F4405; Mon, 3 Sep 2012 14:09:59 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q83I9xWJ008699; Mon, 3 Sep 2012 14:09:59 -0400 Received: from localhost (c-67-186-133-183.hsd1.ma.comcast.net [67.186.133.183]) (authenticated bits=0) (User authenticated as ezyang@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q83I9vd0003736; Mon, 3 Sep 2012 14:09:59 -0400 (EDT) From: "Edward Z. Yang" In-reply-to: <20120903121013.8cpe3jr5wg0kw88k@webmail.mit.edu> To: Alvaro Herrera , sup-devel References: <1345564795-sup-3898@alvh.no-ip.org> <1346648371-12305-1-git-send-email-ezyang@mit.edu> <1346648395-sup-4546@javelin> <1346688000-sup-4643@alvh.no-ip.org> <1346688387-sup-5906@alvh.no-ip.org> <20120903121013.8cpe3jr5wg0kw88k@webmail.mit.edu> Date: Mon, 03 Sep 2012 14:09:57 -0400 Message-Id: <1346695742-sup-7650@javelin> User-Agent: Sup/git X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsUixG6nrlv+ySXAoPG/gcWFyX/YLR5P38Pu wORx5ddEdo99+yYyBzBFcdmkpOZklqUW6dslcGVc2tzFXPCJveL9reAGxo+sXYycHBICJhJT F09nhrDFJC7cW8/WxcjFISSwj1Hiy8s9LBDOekaJa+e/sUM43UwS+87sZOpi5OBgFlCXWD9P CKSbDch8dOwp2FRhAR+JycdOgU3lFLCTmDL5KTuILSIQJdH+8jVYjZDAX0aJLe16IDaLgKrE mhNfmUBsXgFNibc7b4L1igoISzw50gxmMwvISzRvnc08gZF/FsLmWUgyCxiZVjHKpuRW6eYm ZuYUpybrFicn5uWlFuma6+VmluilppRuYgQHnYvKDsbmQ0qHGAU4GJV4eFd8cA4QYk0sK67M PcQoycGkJMo744NLgBBfUn5KZUZicUZ8UWlOavEhRgkOZiUR3i+LgXK8KYmVValF+TApaQ4W JXHe6yk3/YUE0hNLUrNTUwtSi2CyMhwcShK8/R+BGgWLUtNTK9Iyc0oQ0kwcnCDDeYCGbwCp 4S0uSMwtzkyHyJ9i1OV4OevUXUYhlrz8vFQpcd52kCIBkKKM0jy4ObBk8YpRHOgtYd40kCoe YKKBm/QKaAkT0BLX92BLShIRUlINjMq2wYsD1rrz3/B/duaY4OzAkicmuzctP3U1+23y3nNC v7eua3Y9xbzmkosGP4PH2WWlz2wltQ7ExyoF3ip5u8r0SPC+8rRP0+/ylM08eLdfRitraZ1r SeECLq5Nd27cr5vspVTDtKvvt31Xf4TMWbk9BXO/RW7y/NKq72AsEywmw3L12+/6W0osxRmJ hlrMRcWJAL0lC4HxAgAA Subject: Re: [sup-devel] [PATCH] Inotify support for Maildirs. (FIRST DRAFT) X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org OK, cracked a fix; you need this extra patch: commit f9ea07f3c4982ab46d8171fdba8eabc3af00c840 Author: Edward Z. Yang Date: Mon Sep 3 14:09:34 2012 -0400 sync_back after writing to index, not before. Signed-off-by: Edward Z. Yang diff --git a/lib/sup/index.rb b/lib/sup/index.rb index 13798d6..4b533a7 100644 --- a/lib/sup/index.rb +++ b/lib/sup/index.rb @@ -657,10 +657,6 @@ EOS end def sync_message m, overwrite - ## TODO: we should not save the message if the sync_back failed - ## since it would overwrite the location field - m.sync_back - doc = synchronize { find_doc(m.id) } existed = doc != nil doc ||= Xapian::Document.new @@ -703,6 +699,10 @@ EOS @xapian.replace_document docid, doc end + # sync_back must be after label update, so that inotify gets + # fresh data from the index + m.sync_back + m.labels.each { |l| LabelManager << l } true end _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel