From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.58.247.3 with SMTP id ya3csp596518vec; Mon, 3 Sep 2012 16:40:48 -0700 (PDT) Received: by 10.42.215.144 with SMTP id he16mr16340234icb.19.1346715647769; Mon, 03 Sep 2012 16:40:47 -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 i2si22991223icy.105.2012.09.03.16.40.47; Mon, 03 Sep 2012 16:40:47 -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 4ACC82E08F; Mon, 3 Sep 2012 23:40:47 +0000 (UTC) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by rubyforge.org (Postfix) with ESMTP id BD4D82E062 for ; Mon, 3 Sep 2012 23:31:31 +0000 (UTC) X-AuditID: 1209190c-b7fd26d0000008d9-56-50453dd292bb Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 83.76.02265.2DD35405; Mon, 3 Sep 2012 19:31:31 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q83NVUhg003695; Mon, 3 Sep 2012 19:31:30 -0400 Received: from localhost (dhcp-18-111-7-149.dyn.mit.edu [18.111.7.149]) (authenticated bits=0) (User authenticated as ezyang@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q83NVSMN014272; Mon, 3 Sep 2012 19:31:30 -0400 (EDT) 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> <1346695742-sup-7650@javelin> To: sup-devel In-reply-to: <1346695742-sup-7650@javelin> From: "Edward Z. Yang" Date: Mon, 03 Sep 2012 19:31:28 -0400 Message-Id: <1346714661-sup-2638@javelin> User-Agent: Sup/git X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsUixG6nonvZ1jXA4MdcRosLk/+wWzyevofd gcnjyq+J7B779k1kDmCK4rJJSc3JLEst0rdL4MqYefsLU0Ezf8Wr6acZGxiXcXcxcnBICJhI /DmS3MXICWSKSVy4t56ti5GLQ0hgH6PEuxmbWCGc9YwSR060MoNUCQk0MUlsWsQO0swsoC6x fp4QSJhZQEfizrsJ7BD1s5kkfjzazQqSEBbwkZh87BRYrwhQ/Yel+8FsTgEtiZ1tk9lBbDag +KNjT8HqWQRUJabc7QaL8wpoSvy4B1EvKiAs8eRIMzPEMnmJ5q2zmScwCsxCOGMWkswCRqZV jLIpuVW6uYmZOcWpybrFyYl5ealFuoZ6uZkleqkppZsYQcHIKcmzg/HNQaVDjAIcjEo8vBWf XAKEWBPLiitzDzFKcjApifKetXENEOJLyk+pzEgszogvKs1JLT7EKMHBrCTCq80ElONNSays Si3Kh0lJc7AoifNeTrnpLySQnliSmp2aWpBaBJOV4eBQkuC9ADJUsCg1PbUiLTOnBCHNxMEJ MpwHaPhUkBre4oLE3OLMdIj8KUZFKXHe7SAJAZBERmkeXC8sWbxiFAd6RZj3JEgVDzDRwHW/ AhrMBDTY9b0LyOCSRISUVAPjBqWuQsEf8ccbDvjLB096JG8SuzR1ocGMHmtJ/fIAc451CRo5 nsnxTj37NxYzBT28PGnq+2m7DiTnahze8yLu92w3gdO3DJ5ZfXco7Ft6/frknCSXb888Qxdr La9JDQk0Sted15K+fckxk5cGxoveJjb/8Wjt5U+d+5vx8r2TCjPXHEyeLn5biaU4I9FQi7mo OBEA5ZB+F/ECAAA= 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 Extra note: the ruby-inotify plugin appears to be braindead on at least Ruby 1.8.7 for Ubuntu Precise, and will spin-loop. If sup is chomping 15% CPU on idle, try this patch on ruby-inotify Reported here: https://github.com/ruby-building-blocks/ruby-inotify/issues/8 diff --git a/lib/inotify/inotify_native.rb b/lib/inotify/inotify_native.rb index 66db2b4..27d1043 100644 --- a/lib/inotify/inotify_native.rb +++ b/lib/inotify/inotify_native.rb @@ -115,7 +115,7 @@ require 'ffi' # each_event() provides an easy way to loop over all events as they occur def each_event loop do - ready = IO.select([@io], nil, nil, nil) + ready = IO.select([@io]) event = self.read_event yield event end Excerpts from Edward Z. Yang's message of Mon Sep 03 14:09:57 -0400 2012: > 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