You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Skylm808 (via GitHub)" <gi...@apache.org> on 2026/04/25 01:47:55 UTC
[I] generic 样例中 Java client -> Go server 失败 [dubbo-go-samples]
Skylm808 opened a new issue, #1073:
URL: https://github.com/apache/dubbo-go-samples/issues/1073
# generic 样例中 Java client -> Go server 失败,而 Go->Go / Go->Java 正常
## 问题描述
在 `dubbo-go-samples/generic` 中,按当前 README 的官方方式测试时:
- `Go client -> Go server` 可以正常通过
- `Go client -> Java server` 可以正常通过
- 但 `Java client -> Go server` 失败
因此 `generic` 不能记为整体通过。
## 测试环境
- `dubbo-go-samples` 的 Go 依赖通过 `go.mod replace` 指向本地 `dubbo-go-3.3.2`
- Java 环境:JDK 17
## 复现步骤
### 1. 启动 Go server
```bash
cd generic/go-server/cmd
go run .
```
### 2. 验证 Go client -> Go server
```bash
cd generic/go-client/cmd
go run .
```
结果:
```text
All generic call tests passed
```
### 3. 验证 Java client -> Go server
```bash
cd generic/java-client
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.samples.ApiTripleConsumer"
```
## 实际结果
Java client 调 Go server 失败,关键表现为:
```text
[FAIL] GetUser1(String): DEADLINE_EXCEEDED
[FAIL] GetUser2(String, String): DEADLINE_EXCEEDED
[FAIL] GetUser3(int): DEADLINE_EXCEEDED
[FAIL] GetUser4(int, String): DEADLINE_EXCEEDED
[FAIL] GetOneUser(): DEADLINE_EXCEEDED
[FAIL] GetUsers(String[]): DEADLINE_EXCEEDED
[FAIL] GetUsersMap(String[]): DEADLINE_EXCEEDED
[FAIL] QueryAll(): DEADLINE_EXCEEDED
[FAIL] QueryUser(User): DEADLINE_EXCEEDED
[FAIL] QueryUsers(User[]): DEADLINE_EXCEEDED
```
在较新的 JDK 下,还会先看到 Java 侧异常:
```text
java.lang.reflect.InaccessibleObjectException
```
或:
```text
WARNING: Illegal reflective access by ... hessian-lite ...
```
## 预期结果
按 README 的说明,`generic` 样例中的 Go/Java 泛化调用都应能正常完成,不应只通过 `Go -> Go` 和 `Go -> Java`。
## 补充说明
### Go -> Java 正常
启动 Java server 后:
```bash
cd generic/java-server
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.samples.ApiProvider"
```
再运行:
```bash
cd generic/go-client/cmd
go run .
```
结果仍然是:
```text
All generic call tests passed
```
说明:
- Go client -> Java server 是正常的
### 当前现象更像是定向问题
当前只在 `Java client -> Go server` 这条链路上稳定失败。
## 建议排查方向
- Java generic client 与 Go generic server 的兼容性
- Hessian2 / generic invocation 在 Java -> Go 路径上的序列化与解码
- `User` 结构中 `time.Time` 等字段的跨语言兼容性
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] generic 样例中 Java client -> Go server 失败 [dubbo-go-samples]
Posted by "ywxzm03 (via GitHub)" <gi...@apache.org>.
ywxzm03 commented on issue #1073:
URL: https://github.com/apache/dubbo-go-samples/issues/1073#issuecomment-4322103326
please assign to me
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] generic 样例中 Java client -> Go server 失败 [dubbo-go-samples]
Posted by "ywxzm03 (via GitHub)" <gi...@apache.org>.
ywxzm03 commented on issue #1073:
URL: https://github.com/apache/dubbo-go-samples/issues/1073#issuecomment-4390667664
## 结论
我这边重新排查后,当前判断该问题与 VPN / 隧道网卡影响 Dubbo Java 本机地址选择有关,不是 Java generic -> Go generic 的兼容性等问题
## 测试环境
- dubbo-go-samples 的 Go 依赖通过 go.mod replace 指向本地 dubbo-go-3.3.2
- Java 环境:JDK 17
## 复现现象
开启 VPN 时,Java client -> Go server 失败:
```text
Passed: 0, Failed: 10, Total: 10
```
Dubbo Java 日志中 `current host` 为 VPN/隧道网卡地址:
```text
current host: 198.18.0.1
```
Netty 连接日志中实际远端地址也异常:
```text
R:/198.18.0.1:50052
```
但 Java client 配置的直连地址是:
```text
tri://127.0.0.1:50052
```
此时 Go server 侧没有进入 provider 方法的业务日志。
## 验证结果
关闭 VPN 后,未修改 Java client、Go server、接口定义、`User` 结构和启动参数,Java client -> Go server 可以正常通过:
```text
current host: 10.134.92.16
```
```text
Passed: 10, Failed: 0, Total: 10
```
开启 VPN 时,如果显式忽略 macOS `utun` 网卡,也可以通过以下方法进行规避:
```bash
MAVEN_OPTS="-Ddubbo.network.interface.ignored=utun.*" \
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.samples.ApiTripleConsumer"
```
Windows 下如果存在 WSL / Hyper-V / Docker / VPN / Wintun / TAP / vEthernet 等虚拟网卡,也可以通过以下方法进行规避:
```text
dubbo.network.interface.ignored
dubbo.network.interface.preferred
```
## 对建议排查方向的结论
- Java generic client 与 Go generic server 在当前 sample 覆盖的调用场景下可以互通
- Hessian / generic invocation 编解码链路可以正常工作
- `User.time.Time` 仍是跨语言样例中的潜在风险点,但不是本次 `DEADLINE_EXCEEDED` 的直接原因
- JDK 17+ 下的 `InaccessibleObjectException` 属于 hessian-lite 反射访问噪音,不是主因
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] generic 样例中 Java client -> Go server 失败 [dubbo-go-samples]
Posted by "CAICAIIs (via GitHub)" <gi...@apache.org>.
CAICAIIs commented on issue #1073:
URL: https://github.com/apache/dubbo-go-samples/issues/1073#issuecomment-4322061906
@maizhiqiang
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] generic 样例中 Java client -> Go server 失败 [dubbo-go-samples]
Posted by "Skylm808 (via GitHub)" <gi...@apache.org>.
Skylm808 commented on issue #1073:
URL: https://github.com/apache/dubbo-go-samples/issues/1073#issuecomment-4415489583
收到,确认了,问题更像是 VPN影响 Dubbo Java 选本机地址,不是 generic 本身有问题。
我这边现象和你说的一致:开 VPN 会超时,关掉后恢复正常。感谢定位。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] generic 样例中 Java client -> Go server 失败 [dubbo-go-samples]
Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl closed issue #1073: generic 样例中 Java client -> Go server 失败
URL: https://github.com/apache/dubbo-go-samples/issues/1073
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org