From 44ca0096e1b2b638ead24b4898cc34aa3b603926 Mon Sep 17 00:00:00 2001 From: Maksym Pavlenko Date: Sat, 3 Feb 2024 09:50:16 -0800 Subject: [PATCH] Add comment Signed-off-by: Maksym Pavlenko --- services.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services.go b/services.go index f22a2e113..6d092bf95 100644 --- a/services.go +++ b/services.go @@ -140,6 +140,10 @@ func (s *serviceSet) handle(ctx context.Context, req *Request, respond func(*sta 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 { unmarshal := func(obj interface{}) error { return protoUnmarshal(req.Payload, obj)