incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Bartell <snbart...@gmail.com>
Subject EventSource periodically dumps db contents.
Date Fri, 12 Apr 2013 07:45:06 GMT
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