feathersjs-ecosystem / feathers-sync

Synchronize service events between Feathers application instances
MIT License
222 stars 41 forks source link

Mubsub: broken cursor #92

Closed dottodot closed 4 years ago

dottodot commented 5 years ago

I have 2 apps both using feathers-sync, both on the same servers and both connecting the same mongo replica set although using seperate databases. But on one of the app I keep getting this error.

I'm posting in here as feathers-sync is the only package I have installed that uses mubsub which hasn't been updated in a while and doesn't look like any of the issues are being answered.

error: uncaughtException: Mubsub: broken cursor.
Error: Mubsub: broken cursor.
    at Timeout._onTimeout (/app/node_modules/mubsub/lib/channel.js:159:40)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5) {"error":{},"stack":"Error: Mubsub: broken cursor.\n    at Timeout._onTimeout (/app/node_modules/mubsub/lib/channel.js:159:40)\n    at ontimeout (timers.js:498:11)\n    at tryOnTimeout (timers.js:323:5)\n    at Timer.listOnTimeout (timers.js:290:5)","exception":true,"date":"Tue Sep 25 2018 13:33:34 GMT+0000 (UTC)","process":{"pid":37,"uid":5000,"gid":5000,"cwd":"/app","execPath":"/app/.heroku/node/bin/node","version":"v8.12.0","argv":["/app/.heroku/node/bin/node","/app/src"],"memoryUsage":{"rss":254562304,"heapTotal":158777344,"heapUsed":122627880,"external":96841016}},"os":{"loadavg":[0.158203125,0.12060546875,0.13720703125],"uptime":14526604},"trace":[{"column":40,"file":"/app/node_modules/mubsub/lib/channel.js","function":"Timeout._onTimeout","line":159,"method":"_onTimeout","native":false},{"column":11,"file":"timers.js","function":"ontimeout","line":498,"method":null,"native":false},{"column":5,"file":"timers.js","function":"tryOnTimeout","line":323,"method":null,"native":false},{"column":5,"file":"timers.js","function":"Timer.listOnTimeout","line":290,"method":"listOnTimeout","native":false}]}
dottodot commented 5 years ago

This releated to https://github.com/feathersjs-ecosystem/feathers-sync/issues/94, beacuse of the leak the app keeps crashing which causes this error.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here.

christo-ph commented 5 years ago

I am experience this issue as well. How comes this is related to the memory leak, if any?

And: How to circumvent this issue? Any workarounds found?

christo-ph commented 5 years ago

Just tested it with Redis. It works as aspected.

Would be nice to know why Mubsub breaks here. Because with Redis, I have another dependency which makes the app more complex.

daffl commented 5 years ago

Looking at other issues like #110 and #119 it looks like Mubsub just doesn't work very well with newer versions and does not appear to be maintained anymore. I'm inclined to remove it.

MarcGodard commented 4 years ago

@daffl I want to try to fix this, as it is preventing me from using multiple concurrence. Any tips before I start?

daffl commented 4 years ago

I was planning on completely replacing mubsub with a from-scratch implementation of a MongoDB collection watcher but didn't get to it yet.