Skip to content

Fix metadata compatibility for mixed Dubbo and Triple protocols - #16525

Open
hehuang139 wants to merge 2 commits into
apache:3.3from
hehuang139:codex/fix-15641-metadata-protocol
Open

hehuang139 wants to merge 2 commits into
apache:3.3from
hehuang139:codex/fix-15641-metadata-protocol

Conversation

@hehuang139

@hehuang139 hehuang139 commented Oct 19, 2026 •

Copy link
Copy Markdown

What is the purpose of the change?

Fixes #15641.

With local metadata and both dubbo and tri protocols, MetadataService V1 can be exported over Dubbo while the advertised URL points to the Triple V2 endpoint. A Dubbo 3.1.11 consumer then calls the V1 interface on that endpoint and fails with UNIMPLEMENTED: Invoker for gRPC not found, even with only-use-metadata-v2=false.

Export both metadata versions over Triple when V2 is enabled and advertise the V1 URL parameters for compatibility. Keep the V2 capability marker so current consumers still negotiate V2. Honor an explicit metadata protocol from either the application property or its parameters map when deciding whether to enable V2. The RPC tests allocate available protocol ports to avoid the cached default port colliding with other tests.

Validation on Linux with Maven 3.9.9:

  • On JDK 17, an independent released Dubbo 3.1.11 consumer reproduced the error against the original provider and retrieved metadata successfully after the fix.
  • Passed 8 RPC/customizer tests on JDK 21 and 25, covering mixed protocols, Triple dual-version/V2-only, Dubbo-only, and explicit metadata protocol settings. The RPC cases check legacy V1 calls and current V1/V2 negotiation as applicable.
  • Passed all 45 tests in the metadata API module on JDK 21, including ten configuration cases for protocol override priority and fallback behavior.
  • Reproduced the CI port collision by occupying port 50051; the revised test passed with that port occupied.
  • Passed spotless:check for both changed modules and git diff --check.

Test commands (after installing reactor dependencies, with JAVA_HOME and PATH set to the indicated JDK):

# JDK 25: focused RPC, customizer, and configuration tests
MAVEN_OPTS=--sun-misc-unsafe-memory-access=allow mvn -B -ntp -pl dubbo-config/dubbo-config-api,dubbo-metadata/dubbo-metadata-api test -Dtest=MetadataServiceProtocolTest,MetadataServiceURLParamsMetadataCustomizerTest,MetadataServiceVersionUtilsTest -DenableEmbeddedZookeeper=false -Dspotless.skip=true -Pjacoco,jdk15ge-simple,'!jdk15ge-add-open'
# JDK 21: all metadata API tests
mvn -B -ntp -pl dubbo-metadata/dubbo-metadata-api test jacoco:report -DenableEmbeddedZookeeper=false -Pjacoco,jdk15ge-simple,'!jdk15ge-add-open'

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction.
  • Make sure GitHub Actions can pass.

@codecov-commenter

codecov-commenter commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.93%. Comparing base (b73b9d1) to head (de142e9).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #16525      +/-   ##
============================================
+ Coverage     60.89%   60.93%   +0.04%     
- Complexity    11753    11754       +1     
============================================
  Files          1953     1953              
  Lines         89278    89286       +8     
  Branches      13475    13478       +3     
============================================
+ Hits          54367    54408      +41     
+ Misses        29329    29298      -31     
+ Partials       5582     5580       -2     
Flag Coverage Δ
integration-tests-java21 32.07% <57.14%> (+<0.01%) ⬆️
integration-tests-java8 32.20% <57.14%> (+0.01%) ⬆️
samples-tests-java21 32.09% <42.85%> (-0.05%) ⬇️
samples-tests-java8 29.72% <42.85%> (-0.03%) ⬇️
unit-tests-java11 59.16% <100.00%> (+0.03%) ⬆️
unit-tests-java17 58.65% <100.00%> (+0.04%) ⬆️
unit-tests-java21 58.62% <100.00%> (+<0.01%) ⬆️
unit-tests-java25 58.59% <100.00%> (+0.03%) ⬆️
unit-tests-java8 59.20% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hehuang139

Copy link
Copy Markdown
Author

Fixed the Java 21 and 25 CI failures in de142e9. Both jobs failed because the new RPC test reused cached Triple port 50051. The test now allocates explicit available protocol ports. A local reproduction with a real socket occupying 50051 failed before this change and passed afterward.

Added ten configuration cases covering application-property priority over the parameters map, empty or unrelated parameters, and fallback without an application configuration. The protocol-selection conditions highlighted by Codecov now have full branch coverage in the local JaCoCo report.

Validation on Linux:

  • JDK 21: all 45 metadata API tests and 8 RPC/customizer tests pass.
  • JDK 25: all 18 focused configuration/RPC tests pass with the CI JVM/profile settings.
  • Spotless and diff checks pass.

Updated the PR description with these results. CI will validate the updated commit.

This branch has not been deployed

No deployments
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.

[Bug] org.apache.dubbo.remoting.http12.exception.HttpStatusException: Invoker for gRPC not found

2 participants