Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 85899 invoked from network); 28 Nov 2009 12:20:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Nov 2009 12:20:15 -0000 Received: (qmail 81051 invoked by uid 500); 28 Nov 2009 12:20:13 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 80980 invoked by uid 500); 28 Nov 2009 12:20:13 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 80970 invoked by uid 99); 28 Nov 2009 12:20:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Nov 2009 12:20:13 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dionne@dionne-associates.com designates 69.89.22.11 as permitted sender) Received: from [69.89.22.11] (HELO outbound-mail-101.bluehost.com) (69.89.22.11) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 28 Nov 2009 12:20:08 +0000 Received: (qmail 12713 invoked by uid 0); 28 Nov 2009 12:19:47 -0000 Received: from unknown (HELO host183.hostmonster.com) (74.220.207.183) by outboundproxy3.bluehost.com with SMTP; 28 Nov 2009 12:19:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=dionne-associates.com; h=Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer:X-Identified-User; b=kUYaBqLXcA2EB2CjSSZDz8GTsP1vEzj4f7p3Q79jYyakgK9ghxbXVJZ57ALOHauY+Fb+yMCeKXKxnzPKWLyXNGgfGwy/K/Y51AcPdVPATYZHBeuYAz+fizL/dsw9xtdH; Received: from adsl-99-35-59-53.dsl.wlfrct.sbcglobal.net ([99.35.59.53] helo=[192.168.1.101]) by host183.hostmonster.com with esmtpa (Exim 4.69) (envelope-from ) id 1NEMHC-0006kH-OJ for user@couchdb.apache.org; Sat, 28 Nov 2009 05:19:47 -0700 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Mime-Version: 1.0 (Apple Message framework v1076) Subject: Re: filters for _changes dont seem to work From: Robert Dionne In-Reply-To: <20091125.141222.19712.0@webmail18.dca.untd.com> Date: Sat, 28 Nov 2009 07:19:45 -0500 Content-Transfer-Encoding: 7bit Message-Id: <560501C7-0F0C-451D-8BAF-8932A967FCB6@dionne-associates.com> References: <20091125.141222.19712.0@webmail18.dca.untd.com> To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1076) X-Identified-User: {2551:host183.hostmonster.com:dionneas:dionne-associates.com} {sentby:smtp auth 99.35.59.53 authed with dionne@dionne-associates.com} I just happened to be looking at the code that handles this and am wondering if it's a timing issue. Could you try increasing the timeout or not specifying it (the default looks to be 60s) and/or setting delayed_commits to false in the config file. I could be that the code that runs the filters is not getting the notifications in time. I"m just speculating but it's an easy test to try. Cheers, Bob On Nov 25, 2009, at 2:12 PM, slubowsky@netzero.net wrote: > I am trying to use a simple filter to filter the changes I get when > asking for changes using the _changes API. > > I find that often the filter is not even called (I write a message > to the log when the filter is called, when it returns false, and > when it returns true) and I don't get changes I should have received > (especially changes to existing documents, new documents seem to do > better, deletes never get included, not even the first one). > > What typically happens is that the first couple of changes do get > through as expected (and I see the appropriate log messages written > by the filter) but then after a few updates, my filter doesn't even > get called (I see no log messages from my filter) and couch seems to > decide on its own not include the change but just updates the > last_seq number and sends that. > > My filter and a snippet of the log file showing one PUT causing the > filter to be called and a change sent out, followed by a nearly > identical PUT that doesn't even cause the filter to be called and > the change fails to get sent out follows. > > Any help would be appreciated. > Thanks > Stephen > > function(doc, req) { > log('filter called'); > if(req.query.time >= doc.dateOf_) { > log('filter passed'); > return true; > } else { > log('filter failed'); > return false; > } > } > > [Wed, 25 Nov 2009 13:37:06 GMT] [info] [<0.11350.0>] 10.50.17.52 - - > 'GET' /thing0a321134-24df-0585/_changes? > feed=longpoll&timeout=10000&since=84&filter=test/ > deltas&time=1259170547605&_=1259174167457 200 > > [Wed, 25 Nov 2009 13:37:14 GMT] [info] [<0.11363.0>] 127.0.0.1 - - > 'PUT' /thing0a321134-24df-0585/C41924D7-8B00-0001-D841-1E21AD40B120 > 201 > > [Wed, 25 Nov 2009 13:37:14 GMT] [info] [<0.7003.0>] OS Process :: > filter called > > [Wed, 25 Nov 2009 13:37:14 GMT] [info] [<0.7003.0>] OS Process :: > filter passed > > [Wed, 25 Nov 2009 13:37:15 GMT] [info] [<0.11023.0>] 10.50.17.52 - - > 'GET' /thing0a321134-24df-0585/_changes? > feed=longpoll&timeout=10000&since=85&filter=test/ > deltas&time=1259170547605&_=1259174176091 200 > > [Wed, 25 Nov 2009 13:37:15 GMT] [info] [<0.4049.0>] checkpointing > view update at seq 85 for thing0a321134-24df-0585 _design/test > > [Wed, 25 Nov 2009 13:37:21 GMT] [info] [<0.11382.0>] 127.0.0.1 - - > 'PUT' /thing0a321134-24df-0585/C41924D7-8B00-0001-D841-1E21AD40B120 > 201 > > [Wed, 25 Nov 2009 13:37:22 GMT] [info] [<0.11350.0>] 10.50.17.52 - - > 'GET' /thing0a321134-24df-0585/_changes? > feed=longpoll&timeout=10000&since=86&filter=test/ > deltas&time=1259170547605&_=1259174182984 200 > > > ____________________________________________________________ > Human Resource Training > Complete an accredited human resources degree, 100% online. Free info! > http://thirdpartyoffers.netzero.net/TGL2231/c?cp=FFjGpJY4nPYAJ60w7RLkJAAAJz7PXgnlLC7u5ZtKh1zh0o-lAAQAAAAFAAAAAEa2Mz4AAAMlAAAAAAAAAAAAAAAAAAASIwAAAAA=