Skip to content

Introduce MacOSDnsServerAddressStreamProvider which correctly detect …#9161

Merged
normanmaurer merged 1 commit into4.1from
resolver_macos
Oct 28, 2019
Merged

Introduce MacOSDnsServerAddressStreamProvider which correctly detect …#9161
normanmaurer merged 1 commit into4.1from
resolver_macos

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

…all nameserver configuration on MacOS

Motivation:

On MacOS it is not really good enough to check /etc/resolv.conf to determine the nameservers to use. We should retrieve the nameservers using the same way as mDNSResponser and chromium does by doing a JNI call.

Modifications:

Add MacOSDnsServerAddressStreamProvider and testcase

Result:

Use correct nameservers by default on MacOS.

@normanmaurer
Copy link
Copy Markdown
Member Author

@netty-bot test this please

<version>0.13.1</version>
<configuration>
<parameter>
<ignoreMissingOldVersion>true</ignoreMissingOldVersion>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this was added as otherwise it would fail as there can be no previous version found of resolver-dns-native-macos.

@normanmaurer
Copy link
Copy Markdown
Member Author

I will merge this one after the next release is out.

@normanmaurer
Copy link
Copy Markdown
Member Author

@netty-bot test this please

@normanmaurer
Copy link
Copy Markdown
Member Author

@netty-bot test this please

…all nameserver configuration on MacOS

Motivation:

On MacOS it is not really good enough to check /etc/resolv.conf to determine the nameservers to use. We should retrieve the nameservers using the same way as mDNSResponser and chromium does by doing a JNI call.

Modifications:

Add MacOSDnsServerAddressStreamProvider and testcase

Result:

Use correct nameservers by default on MacOS.
@normanmaurer normanmaurer removed this from the 4.1.42.Final milestone Sep 25, 2019
@normanmaurer normanmaurer added this to the 4.1.43.Final milestone Sep 25, 2019
@normanmaurer normanmaurer merged commit 939e928 into 4.1 Oct 28, 2019
@normanmaurer normanmaurer deleted the resolver_macos branch October 28, 2019 14:02
normanmaurer added a commit that referenced this pull request Oct 28, 2019
…all nameserver configuration on MacOS (#9161)

Motivation:

On MacOS it is not really good enough to check /etc/resolv.conf to determine the nameservers to use. We should retrieve the nameservers using the same way as mDNSResponser and chromium does by doing a JNI call.

Modifications:

Add MacOSDnsServerAddressStreamProvider and testcase

Result:

Use correct nameservers by default on MacOS.
@anuraaga
Copy link
Copy Markdown
Contributor

Hi @normanmaurer I happened to find this while looking into netty-dns resolution issues on Windows.

line/armeria#2243

Do you think we may need to use a similar JNI approach on Windows too? https://github.com/chromium/chromium/blob/master/net/dns/dns_config_service_win.cc#L498

@normanmaurer
Copy link
Copy Markdown
Member Author

@anuraaga good question... unfortunately I am not very into windows at all, so its hard for me to judge :/

@anuraaga
Copy link
Copy Markdown
Contributor

@normanmaurer Yeah me too ;) Luckily the stream is pluggable so will experiment with some approaches and see if I find any need for something different.

@anuraaga
Copy link
Copy Markdown
Contributor

@normanmaurer Did a deep investigation and we might want a native implementation for Windows too. Java has inherited from the old days a legacy way pre-Windows XP of enumerating DNS server addresses - list all the adapters and query registry for their DNS config

https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/windows/native/libnet/ResolverConfigurationImpl.c#L129

Now adays, it's much better to use GetAdapterAddresses, which by default only returns information about bound adapters

https://github.com/chromium/chromium/blob/master/net/dns/dns_config_service_win.cc#L498

https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses
https://docs.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersinfo

I very much don't want to learn how to use WIndows SDK for this sort of development ;) But can give it a stab if you're open to adding a windows native DNS module. What do you think?

@anuraaga
Copy link
Copy Markdown
Contributor

Sorry for spamming this PR - went ahead and created an issue for more discussion #9796

dongjoon-hyun added a commit to apache/spark that referenced this pull request Dec 5, 2025
…` license

### What changes were proposed in this pull request?

This PR aims to update `NOTICE-binary` with `Netty` 4.2.7 license.
- https://github.com/netty/netty/blob/netty-4.2.7.Final/NOTICE.txt

### Why are the changes needed?

It seems that we updated `Netty Notice` at Apache Spark `3.0.0-preview` with `Netty 4.1.30.Final`.
- #25544

Since there are many changes like the following, we need to update it by simply copying and pasting.
- Netty 4.1.38.Final
  - netty/netty#9344
- Netty 4.1.44.Final
  - netty/netty#9161
- Netty 4.1.54.Final
  - netty/netty#10773
- Netty 4.1.66.Final
  - netty/netty#11256
  - netty/netty#11437
- Netty 4.1.108.Final
  - netty/netty#13864
- Netty 4.2.1.Final
  - netty/netty#14979
- Netty 4.2.7.Final
  - netty/netty#15658

Additionally, I also double-checked newly added transitive license through ASF [LEGAL-700](https://issues.apache.org/jira/browse/LEGAL-700). We are good to go.

- **Apple Public Source License 2.0**
  - https://spdx.org/licenses/APSL-2.0.html

### Does this PR introduce _any_ user-facing change?

No behavior change.

### How was this patch tested?

Manual review.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #53335 from dongjoon-hyun/SPARK-54602.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
dongjoon-hyun added a commit to apache/spark that referenced this pull request Dec 5, 2025
…` license

### What changes were proposed in this pull request?

This PR aims to update `NOTICE-binary` with `Netty` 4.2.7 license.
- https://github.com/netty/netty/blob/netty-4.2.7.Final/NOTICE.txt

### Why are the changes needed?

It seems that we updated `Netty Notice` at Apache Spark `3.0.0-preview` with `Netty 4.1.30.Final`.
- #25544

Since there are many changes like the following, we need to update it by simply copying and pasting.
- Netty 4.1.38.Final
  - netty/netty#9344
- Netty 4.1.44.Final
  - netty/netty#9161
- Netty 4.1.54.Final
  - netty/netty#10773
- Netty 4.1.66.Final
  - netty/netty#11256
  - netty/netty#11437
- Netty 4.1.108.Final
  - netty/netty#13864
- Netty 4.2.1.Final
  - netty/netty#14979
- Netty 4.2.7.Final
  - netty/netty#15658

Additionally, I also double-checked newly added transitive license through ASF [LEGAL-700](https://issues.apache.org/jira/browse/LEGAL-700). We are good to go.

- **Apple Public Source License 2.0**
  - https://spdx.org/licenses/APSL-2.0.html

### Does this PR introduce _any_ user-facing change?

No behavior change.

### How was this patch tested?

Manual review.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #53335 from dongjoon-hyun/SPARK-54602.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 191ce4c)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants