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
Upgrade GRPC version due to new feature introduced in 1.40.0 version. #583
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for your contribution.
Please note that you can overwrite the dependency versions using the grpc-bom. |
@luankevinferreira Could you please check why the tests are failing? |
@ST-DDT I've looked at the logs and seemed to be some temporary failure with host name resolution, I've updated the branch and now is requiring an approval of the workflow to be run, could you please approve? |
SelfNameResolverConnectionTest > testSelfConnection() FAILED
io.grpc.StatusRuntimeException: UNAVAILABLE: Unable to resolve host self
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156)
at net.devh.boot.grpc.test.proto.TestServiceGrpc$TestServiceBlockingStub.normal(TestServiceGrpc.java:579)
at net.devh.boot.grpc.test.setup.SelfNameResolverConnectionTest.testSelfConnection(SelfNameResolverConnectionTest.java:62)
Caused by:
java.lang.RuntimeException: java.net.UnknownHostException: self
at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:223)
at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:282)
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by:
java.net.UnknownHostException: self
at java.net.InetAddress.getAllByName0(InetAddress.java:1281)
at java.net.InetAddress.getAllByName(InetAddress.java:1193)
at java.net.InetAddress.getAllByName(InetAddress.java:1127)
at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:631)
at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:219)
... 5 more AFAICT the |
@ST-DDT does this error was caused by the change of version or is something internally? |
This failure is related to the change in grpc version, although I'm not sure why. |
I checked the respective code and found grpc/grpc-java#8323 to be responsible for the breakage. /**
* Creates a {@link NameResolver} for the given target URI, or {@code null} if the given URI
* cannot be resolved by this factory. The decision should be solely based on the scheme of the
* URI.
*
* @param targetUri the target URI to be resolved, whose scheme must not be {@code null}
* @param args other information that may be useful
*
* @since 1.21.0
*/ The public NameResolver newNameResolver(final URI targetUri, final Args args) {
if (SELF_SCHEME.equals(targetUri.getScheme()) || targetUri.toString().equals(SELF_SCHEME)) {
return new SelfNameResolver(this.properties, args);
}
return null;
} The following needs to be done to fix this:
@luankevinferreira Would you like to give it a try? |
…in the grpc version.
@ST-DDT I did some changes, could you please approve the workflow and review if is everything ok? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original test was intended to test both name based logic and address based lookup.
Now that the name based resolution is no longer be possible we can simplify it to one test.
tests/src/test/java/net/devh/boot/grpc/test/setup/SelfNameResolverConnectionTest.java
Outdated
Show resolved
Hide resolved
tests/src/test/java/net/devh/boot/grpc/test/setup/SelfNameResolverConnectionTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
When I'm using the following plugin with grpc-spring-boot-starter and try to use the 1.40.1 version of grpc-java, an error occurs as mentioned in this issue grpc/grpc-java#8523.