Fix streaming with empty payloads#157
Merged
dmcgowan merged 4 commits intocontainerd:mainfrom Feb 5, 2024
mxpv:empty_payload
Merged
Fix streaming with empty payloads#157dmcgowan merged 4 commits intocontainerd:mainfrom mxpv:empty_payload
dmcgowan merged 4 commits intocontainerd:mainfrom
mxpv:empty_payload
Conversation
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
dmcgowan
approved these changes
Feb 2, 2024
austinvazquez
approved these changes
Feb 3, 2024
cpuguy83
reviewed
Feb 3, 2024
| }() | ||
|
|
||
| if req.Payload != nil { | ||
| if req.Payload != nil || !info.StreamingClient { |
Member
There was a problem hiding this comment.
Can you add a comment here?
I'm not sure I follow why this fixes the issue.
Member
There was a problem hiding this comment.
Thanks for the comment, I'm not sure how that relates to!info.StreamingClient
I guess this comes down to the info struct not really being documented.
So this is the server side and we are forcing it to deliver the empty payload?
Member
Author
There was a problem hiding this comment.
This covers one additional case of client streaming.
This one works:
rpc DivideStream(Sum) returns (stream Part);However if you change signature to:
rpc DivideStream(google.protobuf.Empty) returns (stream Part);It won't work, because google.protobuf.Empty translates into nil payload, so the DivideStream call skipped.
Signed-off-by: Maksym Pavlenko <[email protected]>
cpuguy83
approved these changes
Feb 4, 2024
dmcgowan
approved these changes
Feb 5, 2024
This file contains hidden or 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
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.
Fix #126
I found this one while working on containerd/containerd#9704
Was able to reproduce the issue with integration test and applied fix seems to be sufficient to fix the problem.