-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
dns.setServers() crash #894
Comments
I'm seeing similar results on os x 10.9.5
|
@iojs/tc can someone qualified jump on this? otherwise it'll have to go in to "known issues" in 1.3.0. |
Will do. |
`ares_set_servers()` should terminate all active queries to previous servers before destroying them. When invoking query callback remove it from the queue, to ensure that it won't be called two times. Fix: nodejs#894
I have two solutions to the problem:
What do you think will be most preferable? cc @bnoordhuis |
Would that block new queries from using the updated servers until all outstanding requests finish? If so, any way to have |
The best solution would be that queries created before calling If I understand your solutions correctly, that would mean wait until query completion and queue up new queries. |
Meant what @tellnes said. If that's possible, there's no need to throw. |
Good suggestion. I'll see what I can do. |
Once this is fixed to work like #894 (comment) describes, I can work on adding the |
Use an EE with some state data to gate async resolution operations in c-ares so that setServers() can run independently. Likely a temporary fix for nodejs#894 with a better solution being to fix c-ares to do this without barfing.
@emotional-engineering c-ares is now on GitHub. Would you mind posting your patch as a pull request there? @indutny mentioned they should be more responsive now. |
Filed c-ares/c-ares#41 |
Closing this as it's a duplicate of #1071 (or, 1071 is a duplicate of this... either way, we don't need two issues tracking the same problem). It's still an open issue, however. |
I have to object. This is the original issue tracking the crash. The other one is more of an API topic. @indutny you're still assigned here? |
@silverwind .. ok, no problem :-) just trying to do a bit of housecleaning. |
Ran into this issue today on node v6.9.1 I'm running this loop thousands of times one after another and it works:
but this breaks after two executions resulting in the error in the original post:
has this been fixed for |
@raimondi1337 |
The callback function in cares_query is synchronous and called before closed. So dns.setServers in the synchronous callback before closed will occur crashing. Fixes: nodejs#894 Refs: https://github.com/nodejs/node/blob/v6.9.4/deps/cares/src/ares_process.c#L1332-L1333 Refs: https://github.com/OpenSIPS/opensips/blob/2.3.0/proxy.c PR-URL: nodejs#13050 Reviewed-By: Anna Henningsen <anna@addaleax.net>
The callback function in cares_query is synchronous and called before closed. So dns.setServers in the synchronous callback before closed will occur crashing. Fixes: nodejs#894 Refs: https://github.com/nodejs/node/blob/v6.9.4/deps/cares/src/ares_process.c#L1332-L1333 Refs: https://github.com/OpenSIPS/opensips/blob/2.3.0/proxy.c PR-URL: nodejs#13050 Reviewed-By: Anna Henningsen <anna@addaleax.net>
The callback function in cares_query is synchronous and called before closed. So dns.setServers in the synchronous callback before closed will occur crashing. Fixes: #894 Refs: https://github.com/nodejs/node/blob/v6.9.4/deps/cares/src/ares_process.c#L1332-L1333 Refs: https://github.com/OpenSIPS/opensips/blob/2.3.0/proxy.c Backport-PR-URL: #13724 PR-URL: #13050 Reviewed-By: Anna Henningsen <anna@addaleax.net>
The callback function in cares_query is synchronous and called before closed. So dns.setServers in the synchronous callback before closed will occur crashing. Fixes: #894 Refs: https://github.com/nodejs/node/blob/v6.9.4/deps/cares/src/ares_process.c#L1332-L1333 Refs: https://github.com/OpenSIPS/opensips/blob/2.3.0/proxy.c Backport-PR-URL: #13724 PR-URL: #13050 Reviewed-By: Anna Henningsen <anna@addaleax.net>
If noone noticed - this is fixed with 9.3.0 version and fix seems to be backported to 8.10.0 too. But I monkey patched |
Original commit message: Prevent changing name servers while queries are outstanding Changing name servers doesn't work, per c-ares/c-ares#41. Better to return an error code than to crash. Refs: c-ares/c-ares#41 Refs: c-ares/c-ares#191 Refs: nodejs#894
The callback function in cares_query is synchronous and called before closed. So dns.setServers in the synchronous callback before closed will occur crashing. Fixes: nodejs/node#894 Refs: https://github.com/nodejs/node/blob/v6.9.4/deps/cares/src/ares_process.c#L1332-L1333 Refs: https://github.com/OpenSIPS/opensips/blob/2.3.0/proxy.c
Hi,
In a Vagrant Ubuntu environment, io.js crashes with this code:
Expected result:
Actual result:
Other informations:
DNS test (in
test/simple/test-dns.js
) ends successfully. This bug can be fixed by removing line 102 indeps/cares/src/ares_destroy.c
.Node.js bug: nodejs/node-v0.x-archive#9243
The text was updated successfully, but these errors were encountered: