couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: EventSource periodically dumps db contents.
Date Sun, 14 Apr 2013 14:18:00 GMT
Hi Stephen,

Are you passing a since=N parameter when you reconnect to the changes
feed? The feed=eventsource is, I think, only changing the format of
our changes feed to suit the EventSource spec, it doesn't change the
fundamentals.

B.

On 14 April 2013 00:53, Stephen Bartell <snbartell@gmail.com> wrote:
> I meant to post this in @dev...
>
> Begin forwarded message:
>
>> From: Stephen Bartell <snbartell@gmail.com>
>> Subject: EventSource periodically dumps db contents.
>> Date: April 12, 2013 12:45:06 AM PDT
>> To: "user@couchdb.apache.org" <user@couchdb.apache.org>
>>
>> Hi all,  I've been playing around with EventSource _changes and theres something
that doesn't quite make sense.
>>
>> I'm doing all this from Chrome console on OSX localhost couch@1.3.
>>
>> 1)
>> var connectionSource = new EventSource('/cdb/connection/_changes?feed=eventsource')
>>
>> 2)
>> var connresults = []
>>
>> 3)
>> var connListener = function (e) {
>>   connresults.push(JSON.parse(e.data))
>> }
>>
>> 4)
>> connectionSource.addEventListener('message', connListener, false)
>>
>> I make sure not to trigger any changes on connection database while I set up a second
source.
>> `connresults` is empty at this point.  As I expect.
>>
>> 5)
>> var endpointsSource = new EventSource('/cdb/endpoints/_changes?feed=eventsource')
>>
>> 6)
>> var epresults = []
>>
>> 7)
>> var epListener = function (e) {
>>   epresults.push(JSON.parse(e.data))
>> }
>>
>> 8)
>> endpointsSource.addEventListener('message', epListener, false)
>>
>> Heres the bug.
>> No changes were triggered on __either__ database.
>> `connresults` is loaded with _all_docs of connection database.
>> `epresults` is loaded with the _all_docs of the endpoints database.
>>
>> And over time, these numbers multiply.  For example, connections db really only 233
docs in it and endpoints database really only has 10 docs in it.  But over the course of writing
this email, `connresults` has 1872 things in it and `epresults` has 60 things in it.
>>
>> It seems like right after I add that second source, something crashes and both sources
begin dumping periodically.
>>
>> Thanks,
>> Stephen
>

Mime
View raw message