Skip to content

dns: enable managing independent channels in JS - #14518

Closed
addaleax wants to merge 4 commits into
nodejs:masterfrom
addaleax:channelling
Closed

dns: enable managing independent channels in JS#14518
addaleax wants to merge 4 commits into
nodejs:masterfrom
addaleax:channelling

Conversation

@addaleax

@addaleaxaddaleax commented Jul 27, 2017

Copy link
Copy Markdown
Member

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/

@addaleaxaddaleax 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
@nodejs-github-botnodejs-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
Comment threaddoc/api/dns.md Outdated

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
MemberAuthor

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. :)

Comment threadsrc/cares_wrap.cc Outdated

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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.

Comment threadsrc/cares_wrap.cc Outdated

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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!

Comment threadsrc/cares_wrap.cc Outdated

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment threadlib/dns.js Outdated

Copy link
Copy Markdown
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...

constfn=(name,/* options, */callback)=>{/* ... */};fn.name=bindingNamereturnfn;

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@jasnell Good idea, done!

Comment threadlib/dns.js Outdated

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

Comment threaddoc/api/dns.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

channel?

Copy link
Copy Markdown
MemberAuthor

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!

Comment threadlib/dns.js Outdated

Copy link
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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

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

@addaleax

Copy link
Copy Markdown
MemberAuthor

Landed in cee8d6d...0f5dabe

@addaleaxaddaleax closed this Aug 1, 2017
addaleax added a commit that referenced this pull request Aug 1, 2017
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 1, 2017
Ref: #7231
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 1, 2017
This can be used to implement custom timeouts.
Fixes: #7231
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 1, 2017
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 1, 2017
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 1, 2017
Ref: #7231
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 1, 2017
This can be used to implement custom timeouts.
Fixes: #7231
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 1, 2017
PR-URL: #14518
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@addaleaxaddaleax added the notable-change PRs with changes that should be highlighted in changelogs. label Aug 2, 2017
addaleax added a commit that referenced this pull request Aug 2, 2017
V8 6.0:
The V8 engine has been upgraded to version 6.0, which has a significantly
changed performance profile.
[#14574](#14574)
More detailed information on performance differences can be found at
https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de
Other notable changes:
* **DNS**
* Independent DNS resolver instances are supported now, with support for
cancelling the corresponding requests.
[#14518](#14518)
* **REPL**
* Autocompletion support for `require()` has been improved.
[#14409](#14409)
* **Utilities**
* The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
been implemented.
[#13644](#13644)
* **Added new collaborators**
* [XadillaX](https://github.com/XadillaX) – Khaidi Chu
@addaleaxaddaleax mentioned this pull request Aug 2, 2017
addaleax added a commit that referenced this pull request Aug 3, 2017
V8 6.0:
The V8 engine has been upgraded to version 6.0, which has a significantly
changed performance profile.
[#14574](#14574)
More detailed information on performance differences can be found at
https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de
Other notable changes:
* **DNS**
* Independent DNS resolver instances are supported now, with support for
cancelling the corresponding requests.
[#14518](#14518)
* **N-API**
* Multiple N-API functions for error handling have been changed to support
assigning error codes.
[#13988](#13988)
* **REPL**
* Autocompletion support for `require()` has been improved.
[#14409](#14409)
* **Utilities**
* The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
been implemented as an experimental feature.
[#13644](#13644)
* **Added new collaborators**
* [XadillaX](https://github.com/XadillaX) – Khaidi Chu
addaleax added a commit to addaleax/node that referenced this pull request Aug 4, 2017
This fixes a bug introduced in 727b291
where code managing the `uv_timer_t` for a `ChannelWrap` instance was
left unchanged, when it should have changed the lifetime of the handle
to being tied to the `ChannelWrap` instance’s lifetime.
Fixes: nodejs#14599
Ref: nodejs#14518
addaleax added a commit that referenced this pull request Aug 7, 2017
This fixes a bug introduced in 727b291
where code managing the `uv_timer_t` for a `ChannelWrap` instance was
left unchanged, when it should have changed the lifetime of the handle
to being tied to the `ChannelWrap` instance’s lifetime.
Fixes: #14599
Ref: #14518
PR-URL: #14634
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 7, 2017
This fixes a bug introduced in 727b291
where code managing the `uv_timer_t` for a `ChannelWrap` instance was
left unchanged, when it should have changed the lifetime of the handle
to being tied to the `ChannelWrap` instance’s lifetime.
Fixes: #14599
Ref: #14518
PR-URL: #14634
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
addaleax added a commit that referenced this pull request Aug 7, 2017
V8 6.0:
The V8 engine has been upgraded to version 6.0, which has a significantly
changed performance profile.
[#14574](#14574)
More detailed information on performance differences can be found at
https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de
Other notable changes:
* **DNS**
* Independent DNS resolver instances are supported now, with support for
cancelling the corresponding requests.
[#14518](#14518)
* **N-API**
* Multiple N-API functions for error handling have been changed to support
assigning error codes.
[#13988](#13988)
* **REPL**
* Autocompletion support for `require()` has been improved.
[#14409](#14409)
* **Utilities**
* The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
been implemented as an experimental feature.
[#13644](#13644)
* **Added new collaborators**
* [XadillaX](https://github.com/XadillaX) – Khaidi Chu
cjihrig pushed a commit that referenced this pull request Aug 8, 2017
V8 6.0:
The V8 engine has been upgraded to version 6.0, which has a significantly
changed performance profile.
[#14574](#14574)
More detailed information on performance differences can be found at
https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de
Other notable changes:
* **DNS**
* Independent DNS resolver instances are supported now, with support for
cancelling the corresponding requests.
[#14518](#14518)
* **N-API**
* Multiple N-API functions for error handling have been changed to support
assigning error codes.
[#13988](#13988)
* **REPL**
* Autocompletion support for `require()` has been improved.
[#14409](#14409)
* **Utilities**
* The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
been implemented as an experimental feature.
[#13644](#13644)
* **Added new collaborators**
* [XadillaX](https://github.com/XadillaX) – Khaidi Chu
addaleax added a commit that referenced this pull request Aug 9, 2017
V8 6.0:
The V8 engine has been upgraded to version 6.0, which has a significantly
changed performance profile.
[#14574](#14574)
More detailed information on performance differences can be found at
https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de
Other notable changes:
* **DNS**
* Independent DNS resolver instances are supported now, with support for
cancelling the corresponding requests.
[#14518](#14518)
* **N-API**
* Multiple N-API functions for error handling have been changed to support
assigning error codes.
[#13988](#13988)
* **REPL**
* Autocompletion support for `require()` has been improved.
[#14409](#14409)
* **Utilities**
* The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
been implemented as an experimental feature.
[#13644](#13644)
* **Added new collaborators**
* [XadillaX](https://github.com/XadillaX) – Khaidi Chu
* [gabrielschulhof](https://github.com/gabrielschulhof) – Gabriel Schulhof
cjihrig pushed a commit that referenced this pull request Aug 10, 2017
V8 6.0:
The V8 engine has been upgraded to version 6.0, which has a significantly
changed performance profile.
[#14574](#14574)
More detailed information on performance differences can be found at
https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de
Other notable changes:
* **DNS**
* Independent DNS resolver instances are supported now, with support for
cancelling the corresponding requests.
[#14518](#14518)
* **N-API**
* Multiple N-API functions for error handling have been changed to support
assigning error codes.
[#13988](#13988)
* **REPL**
* Autocompletion support for `require()` has been improved.
[#14409](#14409)
* **Utilities**
* The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
been implemented as an experimental feature.
[#13644](#13644)
* **Added new collaborators**
* [XadillaX](https://github.com/XadillaX) – Khaidi Chu
* [gabrielschulhof](https://github.com/gabrielschulhof) – Gabriel Schulhof
Conflicts:
src/node_version.h
@gibfahn

Copy link
Copy Markdown
Member

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

@gibfahn

Copy link
Copy Markdown
Member

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

Sign up for freeto 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++.caresIssues and PRs related to the c-ares dependency or the cares_wrap binding.dnsIssues and PRs related to the dns subsystem.lib / srcIssues and PRs related to general changes in the lib or src directory.notable-changePRs with changes that should be highlighted in changelogs.semver-minorPRs 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

@addaleax@gibfahn@jasnell@cjihrig@XadillaX@tniessen@nodejs-github-bot