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

[v8.x backport] dns: fix crash while setting server during query #17778

Closed
wants to merge 1 commit into from

Conversation

XadillaX
Copy link
Contributor

@XadillaX XadillaX commented Dec 20, 2017

Backport of #14891

Fix this issue follow these two points:

  1. Keep track of how many queries are currently open. If setServers()
    is called while there are open queries, error out.
  2. For Resolver instances, use option 1. For dns.setServers(), just
    create a fresh new default channel every time it is called, and then
    set its servers list.

Fixes: #14734

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

dns, cares

@nodejs-github-bot nodejs-github-bot added 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. v8.x labels Dec 20, 2017
@XadillaX
Copy link
Contributor Author

/cc @addaleax @bnoordhuis

Fix this issue follow these two points:

1. Keep track of how many queries are currently open. If `setServers()`
   is called while there are open queries, error out.
2. For `Resolver` instances, use option 1. For dns.setServers(), just
   create a fresh new default channel every time it is called, and then
   set its servers list.

Fixes: nodejs#14734
@XadillaX
Copy link
Contributor Author

/cc @addaleax @bnoordhuis

@XadillaX
Copy link
Contributor Author

@XadillaX
Copy link
Contributor Author

XadillaX commented Feb 8, 2018

gibfahn pushed a commit that referenced this pull request Feb 19, 2018
Fix this issue follow these two points:

1. Keep track of how many queries are currently open. If `setServers()`
   is called while there are open queries, error out.
2. For `Resolver` instances, use option 1. For dns.setServers(), just
   create a fresh new default channel every time it is called, and then
   set its servers list.

Fixes: #14734
PR-URL: #14891
Backport-PR-URL: #17778
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
@gibfahn
Copy link
Member

gibfahn commented Feb 19, 2018

Landed in 3588730 with a restored commit message.

@XadillaX in general you can just leave the commit message as it was in master. Thanks for raising this!

@gibfahn gibfahn closed this Feb 19, 2018
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants