diff --git a/pkg/udf/pythonservice/client.go b/pkg/udf/pythonservice/client.go index ad3885902016..f34b444b1b5f 100644 --- a/pkg/udf/pythonservice/client.go +++ b/pkg/udf/pythonservice/client.go @@ -83,10 +83,10 @@ func (c *Client) Run(ctx context.Context, request *udf.Request, pkgReader udf.Pk } stream, err := c.sc.Run(ctx) - defer stream.CloseSend() if err != nil { return nil, err } + defer stream.CloseSend() err = stream.Send(request) if err != nil { return nil, err