dubbo-go
dubbo-go copied to clipboard
[BUG] The current benchmark tool does not support dubbo-java testing
Summary
tools/benchmark's README_CN.md documents dubbo-java as a supported framework (--framework accepts dubbo-java), but neither the client nor the two scripts implement it, and the Java server itself has three blockers: protocol mismatch, build failure and instant shutdown. The three way comparison (dubbo-go / grpc / dubbo-java) has therefore always been missing the Java leg:
- Client rejects it:
client/main.goexits withInvalid frameworkfor--framework dubbo-java. - Scripts don't support it:
run_single.sh/run_all.shfall intoUnsupported framework/Skipping unknown frameworkfordubbo-java. - Protocol mismatch: the Java server speaks the legacy
dubboprotocol with hand-written message classes (packageorg.apache.dubbo.benchmark), while the Go client only speakstriple+protobufand resolvesbenchmark.BenchmarkService— protocol, serialization and service name all disagree, so cross-language calls are impossible. - Build failure:
pom.xmluses${spring-boot.version}as the spring-boot parent version, which Maven cannot resolve while parsing the parent POM (resolution-order limitation), so the build fails. - Instant shutdown: the non-web Spring Boot app (
spring-boot-starter) exits right aftermain()returns; no non-daemon thread keeps the JVM alive, so the port is never listened on.
Affected Locations
| File | Type | Related Source Locations |
|---|---|---|
tools/benchmark/client/main.go |
missing dubbo-java branch |
https://github.com/apache/dubbo-go/blob/main/tools/benchmark/client/main.go (validFrameworks / createCaller only cover dubbo-go/grpc) |
tools/benchmark/scripts/run_single.sh |
missing dubbo-java branch |
https://github.com/apache/dubbo-go/blob/main/tools/benchmark/scripts/run_single.sh (case "$FRAMEWORK" only covers dubbo-go/grpc) |
tools/benchmark/scripts/run_all.sh |
missing dubbo-java branch |
https://github.com/apache/dubbo-go/blob/main/tools/benchmark/scripts/run_all.sh (FRAMEWORKS only dubbo-go/grpc) |
tools/benchmark/server/dubbo-java/pom.xml |
parent version not resolvable | https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/pom.xml (${spring-boot.version} as parent version) |
tools/benchmark/server/dubbo-java/src/main/resources/application.properties |
stale protocol/scan config | https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/src/main/resources/application.properties (dubbo.protocol.name=dubbo, scan.base-packages=org.apache.dubbo.benchmark) |
tools/benchmark/server/dubbo-java/.../BenchmarkService.java / BenchmarkServiceImpl.java |
hand-written messages + wrong package | https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/src/main/java/org/apache/dubbo/benchmark/BenchmarkServiceImpl.java (@DubboService + hand-written BenchmarkRequest/BenchmarkResponse POJOs) |
tools/benchmark/server/dubbo-java/.../BenchmarkServer.java |
exits immediately | https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/src/main/java/org/apache/dubbo/benchmark/BenchmarkServer.java (main returns right after SpringApplication.run) |
Reproduction
# 1) The client rejects it outright
cd tools/benchmark/client && go build -o benchmark-client main.go \
&& ./benchmark-client --framework dubbo-java --payload 1024 --concurrency 50
# 2) The single-case script reports Unsupported
cd tools/benchmark && ./scripts/run_single.sh dubbo-java 1024 protobuf none 50 unary
# 3) The full script skips Java
cd tools/benchmark && ./scripts/run_all.sh
Output before the fix:
[ERROR] Invalid framework: dubbo-java. Valid values: dubbo-go, grpc # client
[ERROR] Unsupported framework: dubbo-java # run_single.sh
[INFO] ==== Testing framework: dubbo-go ==== # run_all.sh only
[INFO] ==== Testing framework: grpc ==== # dubbo-go/grpc
Root Cause
- Docs vs code divergence: the README lists
dubbo-javaas supported, butvalidFrameworks/createCallerand both scripts'casebranches lack it — "documented but not implemented", so following the README fails. - Cross-language contract mismatch (three places): the Java side speaks
dubbo(Go speakstri), uses hand-written message classes (Go only acceptsprotobufbytes), and exposesorg.apache.dubbo.benchmark.BenchmarkServicewhile the Go client requestsbenchmark.BenchmarkService. Any single mismatch blocks routing to the Java provider. - Broken build chain:
spring-boot-starter-parent's version is${spring-boot.version}, but Maven resolves the parent POM before loading child POM / CLI-injected properties, so the version resolves empty → build failure. - Lifecycle error: the non-web
spring-boot-starterreturns frommain()immediately; with no non-daemon threads left, the JVM exits and the port is never listened on.
Proposed Fix
- Build fixes: resolve the build failure and the artifact-name mismatch with the docs
- Protocol migration: switch the server from the dubbo protocol to triple and align the cross-language contract
- Service registration and liveness: fix the unregistered service and the instant exit
- Client & script integration: complete the end-to-end dubbo-java call path
Fix Status
mvn clean package -DskipTestsbuilds, producingtarget/benchmark-dubbo-java.jar;java -jarstarts within seconds, listens on 20001, exportsbenchmark.BenchmarkService(tri);- The smoke test passed with no failed requests.
请求分配,谢谢
close via #3689