| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Anyone who has time to review this code? |
Sorry, something went wrong.
There was a problem hiding this comment.
Any chance you could name the setters set_FLAG() and the getters just FLAG() (compare with e.g. using_domains)?
Sorry, something went wrong.
There was a problem hiding this comment.
Extremely tiny nit: I’d put these on separate lines
Sorry, something went wrong.
There was a problem hiding this comment.
I realize the code around this doesn’t do it either, but once more, would you mind aligning the arguments vertically? 😄
Sorry, something went wrong.
There was a problem hiding this comment.
tiny nit: Check sounds a bit like it’s just testing things, maybe Ensure is better?
Sorry, something went wrong.
There was a problem hiding this comment.
(ditto for aligning)
Sorry, something went wrong.
There was a problem hiding this comment.
Can we somehow share this code with Initialize, to make it more obviously correct? It looks like there’s quite a bit that could be shared
Sorry, something went wrong.
There was a problem hiding this comment.
I'v extracted these code to SetupCaresChannel().
Sorry, something went wrong.
Sorry, something went wrong.
|
One of Windows CI Machines failed. I wonder why. not ok 2 parallel/test-async-wrap-getasyncid
---
duration_ms: 0.248
severity: fail
stack: |-
Mismatched <anonymous> function calls. Expected 1, actual 0.
at Object.<anonymous> (c:\workspace\node-test-binary-windows\RUN_SUBSET\0\VS_VERSION\vs2015-x86\label\win2008r2\test\parallel\test-async-wrap-getasyncid.js:155:42)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:144:16)
at bootstrap_node.js:561:3
(node:5140) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.Socket instead.
...
|
Sorry, something went wrong.
|
I don't know why, maybe it's the bug of CI? I'm not sure. @addaleax |
Sorry, something went wrong.
|
Yes, the CI failure is nothing to worry about. 👍 (It’s not a bug in the CI but it’s a known failure that’s not related to this PR.) |
Sorry, something went wrong.
|
Hey @addaleax I've already rebased for some conflicts with master. |
Sorry, something went wrong.
Sorry, something went wrong.
|
CI is green. Maybe @bnoordhuis or @silverwind could give this a look, too? |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM modulo comments.
Sorry, something went wrong.
There was a problem hiding this comment.
This fits on one line now.
Sorry, something went wrong.
There was a problem hiding this comment.
Likewise. I'll stop pointing it out from here on.
Sorry, something went wrong.
|
@XadillaX Actually, one more thing: your author name in this commit is given as “XadillaX”. Is that intended or do you prefer to be listed (changelog, git log, AUTHORS file) with some other name? People typically prefer their full name, but ultimately it’s up to you. (Edit: Just to be clear, that name doesn’t have to be ASCII-only – whatever you prefer, really.) |
Sorry, something went wrong.
Fix the bug that you start process without network at first, but it connected lately, `dns.resolve` will stay failed with ECONNREFUSED because c-ares servers fallback to 127.0.0.1 at the very beginning. If c-ares servers "127.0.0.1" is detected and its not set by user self, and last query is not OK, recreating `ares_channel` operation will be triggered to reload servers. Fixes: nodejs#1644
|
@addaleax I think 'XadillaX - Khaidi Chu' would be fine to me. |
Sorry, something went wrong.
|
@addaleax I mean I'd like to use XadillaX when in git log, changelog and authors file. And if someday I have the honor of being a collaborator, I'd like to use 'XadillaX - Khaidi Chu' in the list. |
Sorry, something went wrong.
Fix the bug that you start process without network at first, but it connected lately, `dns.resolve` will stay failed with ECONNREFUSED because c-ares servers fallback to 127.0.0.1 at the very beginning. If c-ares servers "127.0.0.1" is detected and its not set by user self, and last query is not OK, recreating `ares_channel` operation will be triggered to reload servers. Fixes: #1644 PR-URL: #13076 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
|
@addaleax Thanks. I wondered if this PR passed the coverity? Shall I trigger that by myself? |
Sorry, something went wrong.
|
@XadillaX I am not sure how to do that. I think the tool gets run periodically without being triggered, but really, I’m not sure. |
Sorry, something went wrong.
see #13117 (comment) |
Sorry, something went wrong.
|
Should this be backported to v6.x? If so it will require to be done manually |
Sorry, something went wrong.
Fix the bug that you start process without network at first, but it connected lately, `dns.resolve` will stay failed with ECONNREFUSED because c-ares servers fallback to 127.0.0.1 at the very beginning. If c-ares servers "127.0.0.1" is detected and its not set by user self, and last query is not OK, recreating `ares_channel` operation will be triggered to reload servers. Fixes: nodejs#1644 PR-URL: nodejs#13076 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
|
Sorry, something went wrong.
Fix the bug that you start process without network at first, but it connected lately, `dns.resolve` will stay failed with ECONNREFUSED because c-ares servers fallback to 127.0.0.1 at the very beginning. If c-ares servers "127.0.0.1" is detected and its not set by user self, and last query is not OK, recreating `ares_channel` operation will be triggered to reload servers. Fixes: #1644 Backport-PR-URL: #14434 PR-URL: #13076 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Fix the bug that you start process without network at first, but it connected lately, `dns.resolve` will stay failed with ECONNREFUSED because c-ares servers fallback to 127.0.0.1 at the very beginning. If c-ares servers "127.0.0.1" is detected and its not set by user self, and last query is not OK, recreating `ares_channel` operation will be triggered to reload servers. Fixes: #1644 Backport-PR-URL: #14434 PR-URL: #13076 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Fix the bug that you start process without network at first, but it connected lately, `dns.resolve` will stay failed with ECONNREFUSED because c-ares servers fallback to 127.0.0.1 at the very beginning. If c-ares servers "127.0.0.1" is detected and its not set by user self, and last query is not OK, recreating `ares_channel` operation will be triggered to reload servers. Fixes: #1644 Backport-PR-URL: #14434 PR-URL: #13076 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
| Back | FazBrowse Home | New Git URL |
Fix the bug that you start process without network at first, but it connected lately, dns.resolve will stay failed with ECONNREFUSED because c-ares servers fallback to 127.0.0.1 at the very beginning.
If c-ares servers "127.0.0.1" is detected and its not set by user self, and last query is not OK, recreating ares_channel operation will be triggered to reload servers.
You can test with this script:
Turn off your network at first before starting this script. Then try to open the network and then turn off. Make the steps above in a loop and you will get the result.
Fixes: #1644
Solutaion
DNS server matches follow conditions is considered as a fallback server of c-ares:
I created two flags at the process start up.
If cares_query_last_ok_ is true or cares_is_servers_use_default_ is false, everything will be OK.
If not, the code will check current dns servers to see if it's 127.0.0.1 (maybe c-ares' fallback server). When it's 127.0.0.1, old ares_channel will be released and a new one will be created.
Once one query succeeded or not ECONNREFUSED, cares_query_last_ok_ will be marked as true. And once user set dns servers via dns.setServers, cares_is_servers_use_default_ will be marked as false. And what's more, once the first check found the dns servers is not 127.0.0.1, cares_is_servers_use_default_ also will be marked as false.
Checklist
Affected core subsystem(s)
dns