Add comment

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko 2024-02-03 09:50:16 -08:00
parent 6615f159ba
commit 44ca0096e1

View File

@ -140,6 +140,10 @@ func (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*sta
respond(st, p, stream.StreamingServer, true) respond(st, p, stream.StreamingServer, true)
}() }()
// Empty proto messages serialized to 0 payloads,
// so signatures like: rpc Stream(google.protobuf.Empty) returns (stream Data);
// don't get invoked here, which causes hang on client side.
// See https://github.com/containerd/ttrpc/issues/126
if req.Payload != nil || !info.StreamingClient { if req.Payload != nil || !info.StreamingClient {
unmarshal := func(obj interface{}) error { unmarshal := func(obj interface{}) error {
return protoUnmarshal(req.Payload, obj) return protoUnmarshal(req.Payload, obj)