-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(NODE-5106): prevent multiple mongo client connect()s from leaking topology #3596
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally seems like the right thing to do, but I think you'll need to add a test for this. Somebody from the team can probably confirm.
You probably don't need all the complexity of the resource_clean_up.test.ts
file, I think you could just ensure that e.g. when you call client.connect()
twice in the same tick, you'll stil only get one open
event on the MongoClient.
Yes I clarified in the ticket why I did not add a test. I remain available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @clemclx really appreciate your help with this! I've got some ideas to improve the testing a bit here:
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>
Co-authored-by: Neal Beeken <neal.beeken@mongodb.com>
Hey @nbbeeken, |
… topology (#3596) Co-authored-by: Neal Beeken <neal.beeken@mongodb.com> Co-authored-by: Bailey Pearson <bailey.pearson@mongodb.com>
fix(NODE-5106): Add MongoClient connect lock mechanism to avoid topology leak
Description
Related to the ticket opened here : https://jira.mongodb.org/browse/NODE-5106
As mentionned in the issue, not test provided because atm a test cannot be performed according to the beforeHooks awaiting the MongoClient connect.
Double check the following
npm run check:lint
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript