core: copy the SchemaDescriptor when rebuilding descriptor#6851
Merged
zhangkun83 merged 2 commits intogrpc:masterfrom Mar 30, 2020
Merged
core: copy the SchemaDescriptor when rebuilding descriptor#6851zhangkun83 merged 2 commits intogrpc:masterfrom
zhangkun83 merged 2 commits intogrpc:masterfrom
Conversation
|
|
Contributor
|
LGTM |
ejona86
approved these changes
Mar 24, 2020
zhangkun83
reviewed
Mar 24, 2020
| @@ -187,13 +187,15 @@ public static <T> ServerServiceDefinition useMarshalledMessages( | |||
| wrappedMethods.add(wrapMethod(definition, wrappedMethodDescriptor)); | |||
Contributor
There was a problem hiding this comment.
wrappedMethods is never used, and this is causing the CI error.
Member
There was a problem hiding this comment.
Look like the earlier for loop should not have been deleted and should occur after serviceBuilder is created (just like before).
Contributor
Author
There was a problem hiding this comment.
Sorry, not sure what happened--some patching problem on my end. Should look something like this:
// Build the new service descriptor
final ServiceDescriptor.Builder serviceDescriptorBuilder =
ServiceDescriptor.newBuilder(serviceDef.getServiceDescriptor().getName())
.setSchemaDescriptor(serviceDef.getServiceDescriptor().getSchemaDescriptor());
// Create the new service definition.
final ServerServiceDefinition.Builder serviceBuilder =
ServerServiceDefinition.builder(serviceDescriptorBuilder.build());
for (ServerMethodDefinition<?, ?> definition : wrappedMethods) {
serviceBuilder.addMethod(definition);
}
return serviceBuilder.build();
useMarshalledMessages works by duplicating a ServerServiceDefinition while replacing just the marshallers. It currently does not copy over the SchemaDescriptors, which breaks at least the ProtoReflectionService.
dfawley
pushed a commit
to dfawley/grpc-java
that referenced
this pull request
Jan 15, 2021
useMarshalledMessages works by duplicating a ServerServiceDefinition while replacing just the marshallers. It currently does not copy over the SchemaDescriptors, which breaks at least the ProtoReflectionService.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

useMarshalledMessages works by duplicating a ServerServiceDefinition while replacing just the marshallers. It currently does not copy over the SchemaDescriptors, which breaks at least the ProtoReflectionService.