From ac9746ec8310f1954e9237180c225a0102c196e2 Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Mon, 5 Oct 2026 07:22:09 +0800 Subject: [PATCH] =?UTF-8?q?chore(plugins):=20=E7=A7=BB=E9=99=A4=E5=88=86?= =?UTF-8?q?=E7=89=87=E8=AF=8A=E6=96=AD=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SHARD_DEBUG 只在排查「18 个分片为什么还是 12 秒」时用过一次,结论是 17 个 VM 真的在并行(17 VMs live),慢的是其中一个源本身。留着它就是 给热路径留一个 os.Getenv。 --- internal/lua/plugin_shard.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/internal/lua/plugin_shard.go b/internal/lua/plugin_shard.go index aa5fa4e..d72ad90 100644 --- a/internal/lua/plugin_shard.go +++ b/internal/lua/plugin_shard.go @@ -2,7 +2,6 @@ package lua import ( "fmt" - "os" "sync" ) @@ -125,12 +124,6 @@ func (sp *shardPool) ShardCall(name, fn string, argsList []map[string]interface{ }(i) } wg.Wait() - if os.Getenv("SHARD_DEBUG") != "" { - sp.mu.Lock() - idle, live := len(sp.idle), sp.live - sp.mu.Unlock() - fmt.Fprintf(os.Stderr, "[shard] %s.%s: %d args, %d VMs live, %d idle\n", name, fn, len(argsList), live, idle) - } var failed int for _, err := range errs {