Fix metadata compatibility for mixed Dubbo and Triple protocols by hehuang139 · Pull Request #16525 · apache/dubbo · GitHub
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

@hehuang139

Copy link
Copy Markdown
Author

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