couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Dionne <dio...@dionne-associates.com>
Subject Re: filters for _changes dont seem to work
Date Sat, 28 Nov 2009 12:19:45 GMT
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=


Mime
View raw message