Skip to content

Conversation

@addaleax
Copy link
Member

@addaleax addaleax commented Jul 27, 2017

Fixes: #7231

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes (bonus: make test-internet also passes)
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

dns

CI: https://ci.nodejs.org/job/node-test-commit/11400/
CI: https://ci.nodejs.org/job/node-test-commit/11402/
CI: https://ci.nodejs.org/job/node-test-commit/11404/

@addaleax addaleax added cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. dns Issues and PRs related to the dns subsystem. semver-minor PRs that contain new features and should be released in the next minor version. labels Jul 27, 2017
@addaleax addaleax requested review from XadillaX and bnoordhuis July 27, 2017 17:38
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Jul 27, 2017
doc/api/dns.md Outdated
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d be happy to accept other suggestions for the public name here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dns.Resolver?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolver is definitely better, I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XadillaX @jasnell I agree, renamed to Resolver. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This line can segfault, see #14519. As I already stated there, you don't really need to worry about this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not really new code, but yes, I’m changing this to the non-deprecated version of Get so that it “only” crashes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could as well be on one line IMO to be consistent with QueryAWrap::Send etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that’s an oversight. Updated!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can add the timeout option here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/dns.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps make the function anonymous by default then set the name to bindingName before returning...

const fn = (name, /* options, */ callback) => {
  /* ... */
};
fn.name = bindingName
return fn;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell Good idea, done!

lib/dns.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is optional, but it might be worthwhile allowing the servers to be set here as an optional argument.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not in this PR. @XadillaX already mentioned above that there might be other options we could consider adding here, so it seems something to give a little more thought to :)

@addaleax
Copy link
Member Author

doc/api/dns.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

channel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XadillaX Thanks for catching this, done!

lib/dns.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about hide _handle via Object.defineProperty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a plain _handle property is kind of the standard in Node core. If we were to hide something, I’d suggest thinking of a meaningful custom util.inspect overload for resolvers.

@addaleax
Copy link
Member Author

addaleax commented Aug 1, 2017

One more CI: https://ci.nodejs.org/job/node-test-commit/11484/

I’d like to land if it’s green.

@addaleax
Copy link
Member Author

addaleax commented Aug 1, 2017

Landed in cee8d6d...0f5dabe

@addaleax addaleax closed this Aug 1, 2017
@addaleax addaleax added the notable-change PRs with changes that should be highlighted in changelogs. label Aug 2, 2017
@addaleax addaleax mentioned this pull request Aug 2, 2017
@gibfahn
Copy link
Member

gibfahn commented Dec 13, 2017

Should land with #17014 if it lands on v6.x.

@gibfahn
Copy link
Member

gibfahn commented Jan 15, 2018

Release team decided not to land on v6.x, if you disagree let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. cares Issues and PRs related to the c-ares dependency or the cares_wrap binding. dns Issues and PRs related to the dns subsystem. lib / src Issues and PRs related to general changes in the lib or src directory. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants