-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconnect not working when using find #294
Comments
We're using mongodb native driver under the hood so connection options get passed to mongodb native. To pass a auto reconnect option see http://mongodb.github.io/node-mongodb-native/2.1/reference/connecting/connection-settings/ The fun thing about this bug is, that autoReconnect should be enabled by default. |
With this approach, an error is never fired, and all finds execute when the db comes back up, regardless of how long it's down (i tested for 3 minute outage)
|
hi, I'am having a similar is, but with mongojs version |
I'm also seeing this behavior for mongojs going down for over 30 seconds. It times out, and never recovers. Requires a restart of the node.js process to re-connect. |
Hi, I have the similar error it's necessary restart node app for reconnect with db. |
I also face this problem. Any suggestion on this ? |
This issue maybe caused by the default values of reconnectTries (30 times) and reconnectInterval (1 second) based on the doc http://mongodb.github.io/node-mongodb-native/2.1/reference/connecting/connection-settings |
If you bring the db down for over 30 seconds, mongojs does not recover or reconnect.
Db.on('error') is never fired.
Test code:
Result:
Node version: 4.0.0
Mongojs version: 2.3.0
Mongo version: 2.6
The text was updated successfully, but these errors were encountered: