From 2aa3e9cd7d4bcac339f258b1d6ed514866ec3e1f Mon Sep 17 00:00:00 2001 From: Aylei Date: Sun, 14 Jan 2024 17:59:18 +0800 Subject: [PATCH] fix: fixed panic when python server cannot be connected (#14145) fix #13882 Approved by: @YANGGMM, @sukki37 --- pkg/udf/pythonservice/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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