apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.45k stars 26.42k forks source link

[Bug] NetUtils should ignore the local link address #14792

Open cyclinder opened 2 hours ago

cyclinder commented 2 hours ago

Pre-check

Search before asking

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Any

Steps to reproduce this issue

In the K8S scenario, some applications may have two NICs, eth0 and veth0, and eth0 is configured with a real physical address. veth0 is configured with a local link address, which may randomly select the local link address to veth0, resulting in unavailability of the service.

When I look at the netUtils code, I see that netutils only ignores the lookback address, not the local link address.

https://github.com/mercyblitz/dubbo/blob/d8a4acd13c8270bdefe38f8b109dee457ee15593/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java#L148

What you expected to happen

NetUtils should ignore the local link address

Anything else

No response

Are you willing to submit a pull request to fix on your own?

Code of Conduct

wcy666103 commented 2 hours ago

You can submit a pr to try and fix the issue.

cyclinder commented 1 hour ago

I've opened https://github.com/apache/dubbo/pull/14793 to fix this, please take a review in your free time, thanks!