Closed gothammm closed 7 years ago
Since it's been quite some time since this issue was open, I'd like to ask: @peek4y, did you solve your issue? I'm having trouble with it and no luck with google.
Sorry I been bombarded with work. Is the cursor not reconnecting at all?
I'm still looking into it, but it seems that on my dev machine the issue never happens, but in production (AWS) it occurs many times, missing a lot of events. Once or twice it ran for hours without reconnecting.
Not really. We reverted back to the previous version. Dint check after that.
Currently I'm calling tail
again on stream end for reconnection.
It is probably because of the outdated cursor tailing method on mongo-oplog-cursor. In latest node mongo driver documentation it uses the addCursorFlag
method for tailing.
I ended up implementing a cursor and "event streaming" system from scratch with great success, it's been running for more than two weeks now and not a single event was lost or any connection was closed. I tried closing the stream and tailing again on any error event and it ended up creating 400+ connections - that made me give up and create a solution using the latest mongo driver.
it seems we've encountered the same issue. Nice job @edupc, any chance to see it published on a gist please?
@ebourmalo here it is. The exported function expects something like this:
{
collection: 'name',
handlers: [
{
event: 'insert',
handler: (oplogEntry) => {}
},
...
]
}
Hi sorry for my awful late response I know its been long time since this issue was opened. I just had a time to release 2.0.0 this release should address the issue in particular addressing a parent connection that was being opened but not closed https://github.com/cayasso/mongo-oplog/blob/1.x/index.js#L79
Feel free to open this issue if found any related issue. Thanks!
I upgraded to v1, and since then I constantly get this error, on 'error' event.
{ [MongoError: Cursor is closed] name: 'MongoError', message: 'Cursor is closed', driver: true }
I'm not sure what's going on.