-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix streaming with empty payloads #157
Conversation
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
Signed-off-by: Maksym Pavlenko <[email protected]>
@@ -140,7 +140,7 @@ func (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*sta | |||
respond(st, p, stream.StreamingServer, true) | |||
}() | |||
|
|||
if req.Payload != nil { | |||
if req.Payload != nil || !info.StreamingClient { |
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.
Can you add a comment here?
I'm not sure I follow why this fixes the issue.
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.
Added 44ca009
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 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?
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.
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]>
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.