-
Notifications
You must be signed in to change notification settings - Fork 564
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 Client Implementation #8423
Conversation
5715312
to
d3dea55
Compare
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.
Great work!
There are some error handling and logging issues (this being a draft), but the core of the work seems the right thing to do, thanks!
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcBaseClientCall.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcClientCall.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcClientCall.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcClientCall.java
Show resolved
Hide resolved
478b043
to
0be2bf5
Compare
After plugging the client into Coherence I am seeing a lot of severe level log messages due to timeouts. We use a bidirectional channel for Coherence events. The client makes the bi-di request which creates the bi-di The code is in GrpcClientCall line 152
|
That timeout was too aggressive and has now been set to 2 seconds. We shall make this configurable eventually. |
Will there be an option to configure it to never time out? We use a bi-directional channel to receive events related to a cache lifecycle on the client. There may be zero events from the server for the entire lifetime of the client application. |
After running the latest build through our gRPC client tests we have the following issues.
For the latest issues I updated the |
I have been running our gRPC client tests using a build from this PR. The last time I ran them a few weeks ago they were ok. Now I have a failure in our fail-over tests. In this scenario the client has a bidirectional stream open to the server when the server is killed. When running the tests with Netty the client's StreamObserver onError method is called with a StatusRuntimeException with a Status of Unavailable. When using Helidon this does not happen, it appears that Helidon tries to reconnect to the server the next time a messages is sent up the stream by the client. This does not work, in our case because the server is gone and we need to fail over to a new server on another port. Helidon does not allow us to configure multiple server addresses, so this constant reconnect attempt fails until the client eventually gets a timeout exception. We need the clients StreamObserver onError to be called, because basically that stream is dead. In our case we rely on state on the server that was initialised by previous messages, we cannot have a bidirectional stream transparently fail over behind our backs. In our client after the stream receives an error then the our client code can deal with reconnection. In our case we look up the new set of server endpoints and have to create a new Helidon client as the previous client only knows the single address we gave it previously. Obviously if our server was behind a load balancer that would be OK, but in a lot of cases there is no LB. With ManagedChannel in grpc-java there are various ways to pass multiple addresses or to do address lookup whenever the channel is about to connect, but Helidon does not have this. We have been able to work around this in our Helidon client code but it relies on the bidirectional (and presumably any other "stream" type calls) to be properly killed if the server disconnects. |
Further to the above, I copied one of the bidirectional tests in
so that it calls the response listener like this:
At least now my client StreamObserver onError is called when the send fails. But I still have not worked out how to call it when the socket closes. |
d9a51ba
to
3e19765
Compare
After the latest changes I have run our 5,500 gRPC client tests using the Helidon client from this PR and they all pass (including the fail-over tests). |
grpc/core/src/main/java/io/helidon/grpc/core/MarshallerSupplier.java
Outdated
Show resolved
Hide resolved
grpc/core/src/main/java/io/helidon/grpc/core/MarshallerSupplier.java
Outdated
Show resolved
Hide resolved
grpc/core/src/main/java/io/helidon/grpc/core/MarshallerSupplier.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcBaseClientCall.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcClientCall.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcClientCall.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcClientImpl.java
Outdated
Show resolved
Hide resolved
webclient/grpc/src/main/java/io/helidon/webclient/grpc/package-info.java
Show resolved
Hide resolved
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
…to implement @SetupRoute methods.
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
- Cleans all module-info.java files - Switches to System.Logger for logging
… baseUri is not present.
Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
…tStream to allow transitions from HEADERS to END. New tests.
…d timeout on client.
…xceptions thrown in gRPC methods and (2) larger payloads.
Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
…the abort flag is not set, attempts to send a PING frame to verify the connection's health.
…er has died. The period to check for that is configurable and set to 5 seconds by default.
Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
…HTTP/2 logging instead. Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
Description
New gRPC Client API and implementation for SE. Issue #7060.