vsivsi / meteor-job-collection

A persistent and reactive job queue for Meteor, supporting distributed workers that can run anywhere.
https://atmospherejs.com/vsivsi/job-collection
Other
388 stars 68 forks source link

Mongo Timeout Issues #227

Closed kalepail closed 7 years ago

kalepail commented 7 years ago

I have this running in several Meteor applications but I've been noticing a recurring timeout issue lately.

[45.55.72.102]JobQueue: Received error from getWork():  { [MongoError: connection 35 to ds161099.mlab.com:61099 timed out]
[45.55.72.102]  name: 'MongoError',
[45.55.72.102]  message: 'connection 35 to ds161099.mlab.com:61099 timed out' }
[45.55.72.102]Exception in setInterval callback: MongoError: connection 33 to ds161099.mlab.com:61099 timed out
[45.55.72.102]    at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:449:15)
[45.55.72.102]    at [object Object]._.extend._nextObject (packages/mongo/mongo_driver.js:1028:47)
[45.55.72.102]    at [object Object]._.extend.forEach (packages/mongo/mongo_driver.js:1062:22)
[45.55.72.102]    at [object Object].Cursor.(anonymous function) [as forEach] (packages/mongo/mongo_driver.js:911:44)
[45.55.72.102]    at JobCollection._promote_jobs (packages/vsivsi_job-collection/src/server.coffee:194:10)
[45.55.72.102]    at [object Object]._.extend.withValue (packages/meteor.js:1122:17)
[45.55.72.102]    at packages/meteor.js:445:45
[45.55.72.102]    at runWithEnvironment (packages/meteor.js:1176:24)
[45.55.72.102]    - - - - -
[45.55.72.102]    at Function.MongoError.create (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:29:11)
[45.55.72.102]    at Socket.<anonymous> (/bundle/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:186:20)
[45.55.72.102]    at Socket.g (events.js:260:16)
[45.55.72.102]    at emitNone (events.js:67:13)
[45.55.72.102]    at Socket.emit (events.js:166:7)
[45.55.72.102]    at Socket._onTimeout (net.js:333:8)
[45.55.72.102]    at _runOnTimeout (timers.js:537:11)
[45.55.72.102]    at _makeTimerTimeout (timers.js:528:3)
[45.55.72.102]    at Timer.unrefTimeout (timers.js:597:5)

I'm sure you'd need more to sort out exactly what's going on but I'm not sure where to begin to collect more information.

vsivsi commented 7 years ago

Hi, job-collection is built directly on a vanilla Meteor collection. Any problems you may be having with remaining connected to a hosted MongoDB instance are the same as you would have with the underlying collection in Meteor. There is no special job-collection aspect to this issue. The issue is some combination of Meteor and your MongoDB hosting solution. The failure manifesting in your job-collection code is almost certainly just a symptom of the some deeper underlying problem(s). There's not really anything I can do to help with this, as the connection to job-collection is incidental and this is an operational issue.

kalepail commented 7 years ago

Okay, thanks. Really love this package btw.