-
Notifications
You must be signed in to change notification settings - Fork 184
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
wip: trying to debug why we have an extra data frame in the client streaming st case #3148
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…reaming st blocking case
mgodave
commented
Dec 19, 2024
servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultHttpResponse.java
Show resolved
Hide resolved
mgodave
commented
Dec 19, 2024
servicetalk-http-api/src/main/java/io/servicetalk/http/api/HttpContextKeys.java
Show resolved
Hide resolved
...rpc-netty/src/main/java/io/servicetalk/grpc/netty/GrpcTrailersOptimizationServiceFilter.java
Show resolved
Hide resolved
servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultHttpResponse.java
Show resolved
Hide resolved
Closed in favor or #3152 |
idelpivnitskiy
added a commit
that referenced
this pull request
Dec 23, 2024
…any (#3151) Motivation: Behavior was discovered as part of debugging #3148. Currently, `BlockingStreamingHttpService` allocates trailers upfront and concatenates them after the payload body when protocol allows. In result, aggregation of `BlockingStreamingHttpResponse` does not lead to a single HTTP/2 frame because we always expect to receive trailers. However, adding trailers after users close payload writer is race. There are no guarantees that new trailers will be written to the network after close. Therefore, we can inspect the state after close and decide if we need to append trailers or not. Modifications: - Use `scanWithMapper` inside `BlockingStreamingHttpService` instead of always concatenating payload body with trailers; - Create trailers on demand inside `BufferHttpPayloadWriter`, only when users touch them; - Clarify behavior in `HttpPayloadWriter`'s javadoc for trailers-related methods; - Enhance `BlockingStreamingToStreamingServiceTest` to assert new expectations; Result: In `BlockingStreamingHttpService`, trailers are allocated and attached only if users touch trailers before closing `HttpPayloadWriter`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The blocking servicetalk server sends an extra empty data frame on failure even when there aren't any trailers. This causes some issues for the grpc-java client.
Changes
I added a filter and a context key to signal when we have a case where we can avoid sending the extra empty data frame. In the "BROKEN AFTER CHANGE" case below I expect not to see the extra data frame as I am in the previous case but I assume I'm missing a detail about how ST works to be able to be effective in debugging this rn.
Results
Before Change:
After Change: