-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gRPC: Inconsistency in generated method name #9987
Comments
The template has been provided by @pmlopes - Paulo, are you aware of this? |
@pmlopes @michalszynkiewicz @cescoffier looks like something we would like for 1.6, no? |
@gsmet not sure, it's a bit tricky. gRPC convention and java convention are not exactly the same. We have followed the java convention. |
For the record, I've just tried to reproduce the problem in the main branch and got several compilation errors:
The first two come from the |
The extra compiler errors you're seeing appear to be due to added static final fields since the issue was filed. The two methods in the reproducer are so similarly named that these generated fields overlap. Removing or renaming them to not be so close will leave only the errors described in this issue. I have updated the reproducer to remove the overlap. |
Unfortunately, there is no much we can do without breaking the assumption made by other Java gRPC libraries (following the same convention) |
What other gRPC libraries is the project trying to align with? It's been a while since I dove into this code. I'm assuming Vert.x gRPC at a minimum but any others? |
It seems that both Vert.x and Micronaut uses that convention. We may be able to fix it, but need to use a flag to enable this new mapping. Wondering if it worth it (it's going to make the code a lot more complicated). |
I should mention that this may no longer be blocking my use case so I'm fine with closing this issue as part of triage. |
Here are the tests: #29339 |
Describe the bug
The generated method names in quarkus-grpc-protoc-plugin do not match those generated by grpc-java for all valid input. This creates compile errors when the generated Mutiny code tries to delegate to grpc-java's implementation.
Expected behavior
A gRPC method named 'THIS_FAILS' should generate a Java method named 'tHISFAILS'.
Actual behavior
quarkus-grpc-protoc-plugin generates 'tHIS_FAILS' and attempts to delegate to the same name in grpc-java which does not exist.
To Reproduce
Steps to reproduce the behavior:
Environment:
uname -a
orver
:Linux <hostname> 5.3.0-59-generic #53~18.04.1-Ubuntu SMP Thu Jun 4 14:58:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
java -version
:OpenJDK Runtime Environment GraalVM CE 20.0.0 (build 11.0.6+9-jvmci-20.0-b02)
1.5.1.Final
mvnw --version
orgradlew --version
):Additional context
grpc-java's algorithm for converting gRPC method name to Java method name can be found here: https://github.com/grpc/grpc-java/blob/40b815058f1209e66086f4426c407875f47fe400/compiler/src/java_plugin/cpp/java_generator.cpp#L115
The location where the method name is being assigned in Quarkus is here:
quarkus/extensions/grpc/protoc/src/main/java/io/quarkus/grpc/protoc/plugin/MutinyGrpcGenerator.java
Line 114 in 64c18ea
The text was updated successfully, but these errors were encountered: