-
Notifications
You must be signed in to change notification settings - Fork 1
fix: filter out duplicate dns results MONGOSH-2027 #209
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
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.
Code LGTM but this should have a ticket number before merging and an associated spec change
src/rfc-8252-http-server.ts
Outdated
| }); | ||
| }; | ||
|
|
||
| private static async _getAllInterfaces( |
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.
optional suggestions: Feels a bit silly to mark this private and then access it as if it weren't private, no? It's not exported from the package anyway, don't be shy to mark this public to make it a bit more obvious that it's tested directly
And while you're at it, you might as well pass in dns.lookup as an argument instead of mocking it in that case?
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.
I was debating with myself whether I want to make it public or if I want to instead call .listen() and then inspect the logs to see what interfaces were discovered. I feel a bit iffy about exposing methods publicly only for the sake of testing, but perhaps that's a bit more acceptable in the JS world 😅
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.
If that feels iffy, I think you could also just export it as a separate method, it's fairly standalone and not really tied to the rest of the class semantically 🙂
This appears to be the cause of the failures we're seeing in mongosh. The logs indicate that we're getting duplicate dns addresses, which causes us to fire up two servers, one of which will inevitably fail due to address being in use. Here's the corresponding log message: