-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Failed .connect()
hangs Node for 30 seconds
#6028
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
underlying library issue
This issue is a bug with an underlying library, like the MongoDB driver or mongodb-core
Milestone
Comments
sorry I've deleted my previous comment, i was able to reproduce this actually. To clarify, the node process in this script shouldnt hang for 30 seconds, it should exit immediately. I've even tried passing const mongoose = require( 'mongoose' );
const m = new mongoose.Mongoose();
m.connect( 'mongodb://thisdoesntexist:27017', { reconnectTries: 0, useMongoClient: true } )
.then(
() => { console.log( 'Success!' ); },
( err ) => { console.error( err ); }
); |
Tracked this down to a bug in the mongodb driver and put in a patch with some questions, see mongodb-js/mongodb-core#275 |
vkarpov15
added a commit
to mongodb-js/mongodb-core
that referenced
this issue
Feb 10, 2018
daprahamian
pushed a commit
to mongodb-js/mongodb-core
that referenced
this issue
Feb 14, 2018
…tTries = 0 (#275) * fix(connection): make pool not try to reconnect forever when reconnectTries = 0 * test(server): add test coverage for #275 Re: Automattic/mongoose#6028
This was referenced Mar 19, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
underlying library issue
This issue is a bug with an underlying library, like the MongoDB driver or mongodb-core
Tested on 5.0.1 and Node 8.9.4
Results:
Intuitive expectation would be that connection process comes to an end when the
.connect()
promise is rejected. Seems like something keeps going on in the background after that, though.The text was updated successfully, but these errors were encountered: