Skip to content
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

v4.4.0 topology destroyed error #3837

Closed
perrin4869 opened this issue Feb 3, 2016 · 6 comments
Closed

v4.4.0 topology destroyed error #3837

perrin4869 opened this issue Feb 3, 2016 · 6 comments
Milestone

Comments

@perrin4869
Copy link

Hi, I just updated to v4.4.0, and now I see an error during my tests, although I really don't know what the cause could be:

Unhandled rejection MongoError: topology was destroyed

Any clues what could be causing this? I tested v4.3.7 and the error wasn't there.

@vkarpov15
Copy link
Collaborator

I suspect this is related to #3790, because now the .connect() and close() methods now return ES2015 promises. I think the solution will be to just make it so that these functions don't return promises if you specify a callback to minimize impact.

@vkarpov15 vkarpov15 added this to the 4.4.1 milestone Feb 3, 2016
@vkarpov15
Copy link
Collaborator

Also, can you provide a code sample or show how you're connecting?

@vkarpov15 vkarpov15 modified the milestones: 4.4.2, 4.4.1 Feb 3, 2016
@perrin4869
Copy link
Author

Actually, it's a bit convoluted, starting and closing connections before each unit test, I'll try to isolate the problem and report back though! The test still passes btw, so mongoose is working

@perrin4869
Copy link
Author

Made a repository with the problem almost isolated: https://github.com/perrin4869/mongoose_topology_error

@vkarpov15
Copy link
Collaborator

Thanks for the detailed repro instructions, turns out this warning was due to the fact that we had an unhandled rejection internally when model init calls ensureIndexes(), which returns a promise as of #3795. Nothing to really worry about. The above commit will make the warning go away.

@perrin4869
Copy link
Author

Awesome, looking forward to 4.4.2 then, thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants