From 6604bbda8f4a2376dd8d2d0dd2e54ad9d7ea80ec Mon Sep 17 00:00:00 2001 From: SimFG Date: Thu, 26 Sep 2024 14:27:20 +0800 Subject: [PATCH] enhance: [2.4] update the expr version and format the expr http response (#36467) /kind improvement - pr: #36406 Signed-off-by: SimFG --- go.mod | 2 +- go.sum | 4 ++-- internal/http/server.go | 6 +++++- internal/util/flowgraph/node.go | 2 +- pkg/go.mod | 2 +- pkg/go.sum | 4 ++-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index e659f77870..fa4bc00e9d 100644 --- a/go.mod +++ b/go.mod @@ -248,7 +248,7 @@ replace ( github.com/apache/arrow/go/v12 => github.com/milvus-io/arrow/go/v12 v12.0.1 github.com/apache/pulsar-client-go => github.com/milvus-io/pulsar-client-go v0.6.10 github.com/bketelsen/crypt => github.com/bketelsen/crypt v0.0.4 // Fix security alert for core-os/etcd - github.com/expr-lang/expr => github.com/SimFG/expr v0.0.0-20231218130003-94d085776dc5 + github.com/expr-lang/expr => github.com/SimFG/expr v0.0.0-20240919063422-9ca3d5925361 github.com/go-kit/kit => github.com/go-kit/kit v0.1.0 // github.com/milvus-io/milvus-storage/go => ../milvus-storage/go github.com/ianlancetaylor/cgosymbolizer => github.com/milvus-io/cgosymbolizer v0.0.0-20240722103217-b7dee0e50119 diff --git a/go.sum b/go.sum index 18a1737b55..8c0cdc7734 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1 github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/SimFG/expr v0.0.0-20231218130003-94d085776dc5 h1:U2V21xTXzCo7RpB1DHpc2X0SToiy/4PuZ/gEYd5/ytY= -github.com/SimFG/expr v0.0.0-20231218130003-94d085776dc5/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +github.com/SimFG/expr v0.0.0-20240919063422-9ca3d5925361 h1:BaPdIKqIEp7dkTUoTM4I9GOCod8kZ50VT/cdKR+h4YU= +github.com/SimFG/expr v0.0.0-20240919063422-9ca3d5925361/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/actgardner/gogen-avro/v10 v10.1.0/go.mod h1:o+ybmVjEa27AAr35FRqU98DJu1fXES56uXniYFv4yDA= github.com/actgardner/gogen-avro/v10 v10.2.1/go.mod h1:QUhjeHPchheYmMDni/Nx7VB0RsT/ee8YIgGY/xpEQgQ= github.com/actgardner/gogen-avro/v9 v9.1.0/go.mod h1:nyTj6wPqDJoxM3qdnjcLv+EnMDSDFqE0qDpva2QRmKc= diff --git a/internal/http/server.go b/internal/http/server.go index 8463b62201..5e08b016da 100644 --- a/internal/http/server.go +++ b/internal/http/server.go @@ -17,6 +17,7 @@ package http import ( + "encoding/json" "fmt" "net/http" "os" @@ -82,8 +83,11 @@ func registerDefaults() { w.Write([]byte(fmt.Sprintf(`{"msg": "failed to execute expression, %s"}`, err.Error()))) return } + w.Header().Set("Content-Type", "application/json") w.WriteHeader(http.StatusOK) - w.Write([]byte(fmt.Sprintf(`{"output": "%s"}`, output))) + resp := make(map[string]string) + resp["output"] = output + json.NewEncoder(w).Encode(resp) }), }) Register(&Handler{ diff --git a/internal/util/flowgraph/node.go b/internal/util/flowgraph/node.go index 7bfa3bfaeb..1c1685efcd 100644 --- a/internal/util/flowgraph/node.go +++ b/internal/util/flowgraph/node.go @@ -78,7 +78,7 @@ func (nodeCtxManager *nodeCtxManager) Start() { curNode := nodeCtxManager.inputNodeCtx // tt checker start if enableTtChecker { - manager := timerecord.GetCheckerManger("fgNode", nodeCtxTtInterval, func(list []string) { + manager := timerecord.GetCheckerManger("data-fgNode", nodeCtxTtInterval, func(list []string) { log.Warn("some node(s) haven't received input", zap.Strings("list", list), zap.Duration("duration ", nodeCtxTtInterval)) }) for curNode != nil { diff --git a/pkg/go.mod b/pkg/go.mod index 90b2bbcdc9..7480af6331 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -183,7 +183,7 @@ require ( replace ( github.com/apache/pulsar-client-go => github.com/milvus-io/pulsar-client-go v0.6.10 github.com/bketelsen/crypt => github.com/bketelsen/crypt v0.0.4 // Fix security alert for core-os/etcd - github.com/expr-lang/expr => github.com/SimFG/expr v0.0.0-20231218130003-94d085776dc5 + github.com/expr-lang/expr => github.com/SimFG/expr v0.0.0-20240919063422-9ca3d5925361 github.com/go-kit/kit => github.com/go-kit/kit v0.1.0 github.com/ianlancetaylor/cgosymbolizer => github.com/milvus-io/cgosymbolizer v0.0.0-20240722103217-b7dee0e50119 github.com/streamnative/pulsarctl => github.com/xiaofan-luan/pulsarctl v0.5.1 diff --git a/pkg/go.sum b/pkg/go.sum index 46e4ba3857..b5fe3bdf7b 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -60,8 +60,8 @@ github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwS github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= -github.com/SimFG/expr v0.0.0-20231218130003-94d085776dc5 h1:U2V21xTXzCo7RpB1DHpc2X0SToiy/4PuZ/gEYd5/ytY= -github.com/SimFG/expr v0.0.0-20231218130003-94d085776dc5/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +github.com/SimFG/expr v0.0.0-20240919063422-9ca3d5925361 h1:BaPdIKqIEp7dkTUoTM4I9GOCod8kZ50VT/cdKR+h4YU= +github.com/SimFG/expr v0.0.0-20240919063422-9ca3d5925361/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/actgardner/gogen-avro/v10 v10.1.0/go.mod h1:o+ybmVjEa27AAr35FRqU98DJu1fXES56uXniYFv4yDA= github.com/actgardner/gogen-avro/v10 v10.2.1/go.mod h1:QUhjeHPchheYmMDni/Nx7VB0RsT/ee8YIgGY/xpEQgQ= github.com/actgardner/gogen-avro/v9 v9.1.0/go.mod h1:nyTj6wPqDJoxM3qdnjcLv+EnMDSDFqE0qDpva2QRmKc=