-
Notifications
You must be signed in to change notification settings - Fork 146
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
use ipv6 if that is actually supported #149
base: master
Are you sure you want to change the base?
Conversation
7ea310f
to
23d6270
Compare
Thanks for the PR @bobvanderlinden. Unfortunately it is not that easy. Line 151 in resolver_sequence_tasks.js states:
So your current patch will break things on older versions of node on linux. Unfortunately the comment does not mention a specific version (my bad). So, that would require a bit of software archeology... Another thing is: This specific error only happens on Raspberry Pi (distros). I've seen a couple of similar work arounds but I never got a good explanation what is causing it. Could you take a minute to explain what is actually happening? Raspberry Pi and Let me know what you think. |
I'm a bit cautious here because the address resolution is the most brittle part of That's mostly because the avahi compat library does not cope... You've seen the warnings. |
Indeed. Another way to solve this problem is to resolve any of the address-families, instead of all of the address-families. That way older versions of node should still work. |
The thing is: The linux implementation that works around missing functionality in the compat lib, tries hard to mimic the behavior of the original Bonjour SDK. I'm sure you'll agree that that is a desirable property. So breaking that by globally modifying behavior on linux is kind of like a last resort. At the very least I want to understand what the problem is before going down that road. In any case I would be much more comfortable with a solution that probes the behavior of whatever it is that causes the actual error at startup and then carefully modifies a default. Even if you don't know what is actually causing it, maybe you could... like ... walk me through it? Maybe paste a stack and write down what you learned while debugging? |
We have 2 families: 4 and 6.
Even though one of the families had succeeded, Making sure always one family is used in I think it can be changed somehow to have it ignore errors of other families if one family succeeds. I just don't know if this is the right approach: |
Right. Thanks for the explanation. It seems the root cause of this is lack of ipv6 support on these systems. Looks like on Raspbian ipv6 is disabled by default. So let's sketch out a plan:
This feels like the right thing to test for and also side-steps the issue of changing the error behavior. ;) It's obviously more work than just changing the default. So, how about it? Feel like putting in the work? Just let me know what you think... |
Sounds doable. However, why not just propagate errors when all resolve On Fri, Dec 25, 2015 at 5:26 PM David Siegel [email protected]
|
Hehe... me neither. Call me paranoid but I'd rather not ignore them.
Nope. This only affects linux (ahavi). |
Was there any progress on this? The only way I can use this lib is with this PR in place. |
This makes the calls to getaddrinfo use the right address families. The supported address families depend on the NodeJS version as well as the OS.
23d6270
to
776ea07
Compare
Forgot about this issue, since I'm not using node_mdns on docker nor the raspberry pi anymore. However, I thought I'd give this a try anyway. @agnat Agreed. The code of resolver_sequence_tasks does get more complex, but at least we're not ignoring errors. Apparently nodejs v0.11.5 introduced support for family The version comparing could be reused as well for (https://github.com/bobvanderlinden/node_mdns/blob/776ea07d3b8aacc518928434343aef09567128bf/lib/resolver_sequence_tasks.js#L185), but I thought to keep the PR minimal. Maybe using a library for version comparison is a better option, let me know. @prawnsalad Could you give this PR a try again? I don't have the right setup at the moment to test whether this will actually work. On my system all tests do pass. |
This makes sure that if an address in one of the two address families
is found, it won't raise an error due to it not being found in the
other family. This resolves issues on Raspberry Pi and inside docker
containers.