feat(microservices): add keepalive support for server side #15975
+37
−1
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.
PR Checklist
Please check if your PR fulfills the following requirements:
No needed to change documentation. I didn't update any interface i just add missing code for
grpc-server implementation (made as gprc-client)
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently, when I establish a connection between the gRPC client (running on one laptop) and the gRPC server (running on another laptop) and start a bidirectional stream with keepalive enabled, we can successfully detect a disconnection if I turn off the internet on either machine.
The problem is that the detection happens only on the client side—nothing happens on the server side.
It works if I bypass the
keepalivesettings and use the barechannelOptionslike this:reason: We didn't map this values to
keepaliveobject as we do with gprc-clientAnd this approach works on the server too, but it’s not a convenient solution for users of the library. It should be consistent with what we have for the gRPC client (when we can use keepalive)
Issue Number: N/A
What is the new behavior?
Successfully detection on both of side after time what we defined in
keepalivesettings:Now we have same approach on client and server side
Does this PR introduce a breaking change?
Other information
FYI: I can push repo which have client + server application and provide info about testing with different machines or using containers with
iptablesI tested it locally using both a two-machine setup and a multi-container setup. I updated everything locally, built the library, and injected the server files into my project to make the test 100% accurate.
I can provide additional proof if needed.
Thanks