couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Bartell <snbart...@gmail.com>
Subject Fwd: EventSource periodically dumps db contents.
Date Sun, 14 Apr 2013 04:53:45 GMT
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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message