Skip to content

feat: support reflection-backed Triple IDL unary invocation - #1639

Open
AsperforMias wants to merge 5 commits into
apache:developfrom
AsperforMias:fix-idl-generic-invoke
Open

AsperforMias wants to merge 5 commits into
apache:developfrom
AsperforMias:fix-idl-generic-invoke

Conversation

@AsperforMias

Copy link
Copy Markdown
Contributor

Please provide a description of this PR:

Support Triple IDL unary calls through the existing generic invoke API. The current Hessian-based path cannot construct the protobuf messages required by IDL services.

Determine IDL mode from service provider metadata bound to the selected instance. Resolve descriptors through server reflection, validate catalog input/output type names against the reflected method, and use dynamic protobuf messages with protobuf JSON encoding.

Keep legacy non-IDL metadata without ProviderAppName usable. Other applications' IDL modes do not affect the selected provider; conflicting or unknown modes within the bound provider set are rejected. Explicit IDL metadata without a matching instance binding is not used for invocation.

Reflection and invocation share one gRPC connection, closed on success, failure, or cancellation. Business calls preserve attachments and group/version routing headers; reserved attachment keys are rejected. Reflection requests do not carry business routing headers.

The implementation is unary-only, bounds descriptor retrieval, and rejects known TLS/authentication configurations that this path cannot configure. No dependencies or SDK versions are changed.

Validation:

  • The original IDL regression fails before the change and passes afterward.
  • Targeted tests, race tests, vet, and lint for new changes pass.
  • Regression coverage includes legacy non-IDL metadata, provider-mode isolation, signature mismatches, security markers, descriptor limits, attachments, cancellation, and connection closure.
  • Real Admin API calls pass against Nacos- and ZooKeeper-discovered Go Triple providers, including non-empty group/version and attachment echo. All six non-IDL time-argument checks pass.
  • The full test suite still fails only at the existing TestObservabilityInstanceDashboardDispatch/metric assertion.

Server reflection and bound IDL metadata are required. Streaming and TLS/authentication are not implemented. Reflection cannot distinguish divergent schemas for versions of the same service within one process. Java interoperability and UI validation remain unverified.

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Docs
  • Installation
  • User Experience
  • Dubboctl
  • Console
  • Core Component

Please check any characteristics that apply to this pull request.

@robocanic robocanic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invokeIDLService loses the reflected type registry at the protobuf JSON boundary. For example, a provider can declare fixture.Payload in the reflected service file and return it inside a google.protobuf.Any. Both protojson calls here use the default global type registry, which does not contain the provider’s dynamic type. A valid request with this @type fails before dispatch; on the response path the RPC can succeed and Admin still returns an encoding error, potentially prompting the caller to repeat a completed operation.

I reproduced both codec failures with a private descriptor registry and type.googleapis.com/fixture.Payload. Using dynamicpb.NewTypes(files) as the Resolver on both UnmarshalOptions and MarshalOptions made both operations succeed. Please wire the resolver into both calls and add a unary echo regression with an Any carrying a reflected application type that is absent from protoregistry.GlobalTypes.

@sonarqubecloud

Copy link
Copy Markdown

@AsperforMias

Copy link
Copy Markdown
Contributor Author

is there any problem unresolved?

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.

2 participants