-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: make stream wait timeout a first class citizen #1473
Conversation
SonarCloud Quality Gate failed. |
@mutianf We planned a major release but it turned out that we can implement many of the ideas without introducing breaking changes. So GAX is not going to have a major release. However, I think your idea here is worth discussing. Would you add it into the wishlist as a suggested edit? https://docs.google.com/document/d/1oEzsIEr7DFoyG6-QXXZyIyjIZkbe8i2obLOG90RnVKk/edit?resourcekey=0-T1uuNtaLJBuOtIlcRfe2iQ (internal doc) |
Thanks @suztomo, I added to the bottom of the list. Feel free to add me to meetings that discuss these issues! |
gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java
Show resolved
Hide resolved
gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java
Show resolved
Hide resolved
I think the changes make sense. Just left a few questions (trying to get more familiar with the streaming retry logic). |
gax-java/gax-grpc/src/test/java/com/google/api/gax/grpc/TimeoutTest.java
Show resolved
Hide resolved
gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java
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 Mattie for opening this PR! It would be great if we can add a showcase integration test to visualize how customers would use it, and maybe test the behavior of streamWaitTimeout
as well. We already have a basic showcase integration tests for server side streaming.
See the README of showcase module for more details. Ley me know if you have any additional questions regarding showcase integration tests, @burkedavison /@lqiu96 / @mpeddada1 can provide more info as well.
Thanks for reviewing! I'll add showcase integration test and address other comments later. |
gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java
Show resolved
Hide resolved
gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java
Show resolved
Hide resolved
gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java
Show resolved
Hide resolved
showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java
Outdated
Show resolved
Hide resolved
gax-java/gax/src/main/java/com/google/api/gax/rpc/ServerStreamingCallSettings.java
Show resolved
Hide resolved
[gapic-generator-java-root] Kudos, SonarCloud Quality Gate passed! |
[java_showcase_integration_tests] SonarCloud Quality Gate failed. |
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.
Awesome! thanks for fixing this! and I apologize for the original misfeature
[java_showcase_unit_tests] Kudos, SonarCloud Quality Gate passed! |
Port change googleapis/gax-java#1409 because gax is going to have a major version bump.
The original PR was closed because remapping rpcTimeout is too risky. But now gax is having a major version bump soon we're hoping to fix this behavior.
From the original comment:
For a server streaming api, there are 4 conceptual timeouts:
Each has a usecase:
Currently all of them are implemented in gax but the delineation was muddied by me a while back. This PR tries to fix the situation. In the current world, operation timeout is defined by RetrySettings#totalTimeout, idle timeout is defined by ServerStreamingCallSettings#idleTimeout. However RetrySettings#rpcTimeout is mapped to message wait timeout and attempt timeout is only configureable per call using ApiCallContext#withTimeout.
This PR cleans up the situation by mapping RetrySettings#rpcTimeout to attempt timeouts and exposes a new setting for wait timeout on ServerStreamingCallSettings.