From 010a9e2bca7f8ebd587505392abbbd0c1766c17a Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 21 Oct 2021 19:24:28 -0700 Subject: [PATCH] content: close stream after commit request This allows both client and server to determine when stream is completed. Previously this was done by closesend call from the client side but that is async so client can not assume that the server side also already thinks that stream is complete. Signed-off-by: Tonis Tiigi --- services/content/contentserver/contentserver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/content/contentserver/contentserver.go b/services/content/contentserver/contentserver.go index 7b6efdb3a..44b9e4a76 100644 --- a/services/content/contentserver/contentserver.go +++ b/services/content/contentserver/contentserver.go @@ -423,6 +423,10 @@ func (s *service) Write(session api.Content_WriteServer) (err error) { return err } + if req.Action == api.WriteActionCommit { + return nil + } + req, err = session.Recv() if err != nil { if err == io.EOF {