Skip to content

Could not add interceptor(s) to ProtoReflectionService #3469

@jyane

Description

@jyane

What did you do?

Add interceptor(s) to ProtoReflectionService.

What did you expect to see?

ProtoReflectionService works with interceptor(s).

What did you see instead?

Got a NullPointerException or compilation error.

Problem

I ask a question on Gitter.
https://gitter.im/grpc/grpc?at=59b9090bcfeed2eb65033bad
and I have got a reply from @e.jona86.
https://gitter.im/grpc/grpc?at=59b9a7f9c101bc4e3ac3404a
I think it is not easy to fix. So I report an issue.

ProtoReflectionService needs a reference to Server via notifyOnBuild but it could not, because an intercepted service is an instance of ServerServiceDefinition.

I think it is consisting some problems (may not a bug or may not a problem) as below.

  • ServerInterceptors#intercept binds a service and returns ServerServiceDefinition.
  • ServerBuilder#addService doesn't add ServerServiceDefinition to notifyOnBuildList.
  • ServerServiceDefinition doesn't implement InternalNotifyOnBuild.

Therefore, I could not add interceptor(s) to ProtoReflectionService.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions