Repository navigation
Description
[Bug]: 4.2 AP CN crashes with negative WaitGroup counter in the conntrack/socket receive watcher during Family concurrency
Summary
A 4.2 AP CN process panicked in a background conntrack receive path during the scheduled Family concurrency workload. This is an observed service-availability failure, not just an expected SQL cancellation or a test comparison failure. The precise cause of the WaitGroup invariant violation is not established; this report does not assert a defect in the dependency itself.
Version and environment
- Scheduled Family run 41077158867, branch 4.2-dev.
- Actual MatrixOne commit: 6aa5cfc. The workflow repository revision is a different identity.
- Image digest:
sha256:ec5ad00427e165c64bbf909ddcfc2045aefbcc5a08062178dbab56449b0ab391. - Immutable-image build job records
go version go1.26.4 linux/amd64,GOAMD64=v3,GOEXPERIMENT=simd, andgo build -mod=readonly ... ./cmd/mo-service, without an extra build-tag argument. - Affected namespace:
mo-42-family-41077158867-1; AP pod:nightly-regression-dis-ap-cn-nlf7h. - Dependencies in the tested go.mod and observed stack: socket v0.5.1, netlink v1.7.2, netfilter v0.5.2, conntrack v0.5.1.
Observed sequence and impact (UTC, 2026-10-30)
- At 22:49:46, the ALTER MODIFY workload first reports connection failures, and a new process starts in the AP container. The earlier process's exit cause is not available from the retained Kubernetes lastState. Do not assume it was this panic or an OOM.
- At 22:51:52.906269717, the replacement process logs
panic: sync: negative WaitGroup counter. - At 22:52:21, the replacement process exits with reason Error / exit code 134. The update-primary-key workload first reports connection failures at the same second.
- At 22:52:34, the container starts again. The resource receipt records restartCount=2 for this AP, and zero restarts for the other eight pods.
Resource job / native resource artifact with pods.json.
FullConcurrent job / native workload artifact: ALTER MODIFY has 85,323 successes / 84 errors; update-primary-key has 212,077 successes / 120 errors. The latter's separate final cardinality check passes (1000000|1000000|1000000); this does not remove the intermediate availability failure.
Panic and recovered caller stack
The following function/file sequence is copied from the same fatal dump. Runtime register addresses are omitted. The complete selected goroutine text is retained separately; this is not a claim to have collected the entire process dump.
panic: sync: negative WaitGroup counter
goroutine 8571 [running]:
panic
runtime/panic.go:879
sync.(*WaitGroup).Add(..., -1)
sync/waitgroup.go:118
sync.(*WaitGroup).Done
sync/waitgroup.go:156
github.com/mdlayher/socket.rwT[...].func2.deferwrap1()
github.com/mdlayher/[email protected]/conn.go:776
github.com/mdlayher/socket.rwT[...].func2()
github.com/mdlayher/[email protected]/conn.go:787
runtime.goexit
created by github.com/mdlayher/socket.rwT[...] in goroutine 402
github.com/mdlayher/[email protected]/conn.go:775
goroutine 402 [semacquire]:
runtime.gopark / runtime.goparkunlock / runtime.semacquire1
internal/poll.runtime_Semacquire
internal/poll.(*fdMutex).rwlock
internal/poll.(*FD).readLock / internal/poll.(*FD).RawRead
internal/poll/fd_unix.go:699
os.(*rawConn).Read
syscall.RawConn.Read-fm
github.com/mdlayher/socket.rwT[...]
github.com/mdlayher/[email protected]/conn.go:795
github.com/mdlayher/socket.readT[...]
github.com/mdlayher/[email protected]/conn.go:666
github.com/mdlayher/socket.(*Conn).Recvmsg
github.com/mdlayher/[email protected]/conn.go:572
github.com/mdlayher/netlink.(*conn).Receive
github.com/mdlayher/[email protected]/conn_linux.go:145
github.com/mdlayher/netlink.(*Conn).receive / lockedReceive / Receive
github.com/ti-mo/netfilter.(*Conn).Receive
github.com/ti-mo/[email protected]/conn.go:107
github.com/ti-mo/conntrack.(*Conn).eventWorker
github.com/ti-mo/[email protected]/conn.go:127
github.com/ti-mo/conntrack.(*Conn).Listen.gowrap1
github.com/ti-mo/[email protected]/conn.go:110
runtime.goexit
created by github.com/ti-mo/conntrack.(*Conn).Listen in goroutine 1
github.com/ti-mo/[email protected]/conn.go:110
goroutine 403 [select]:
main.logConnTrack
cmd/mo-service/debug_connections.go:79
main.startConnectionTracking.func2
cmd/mo-service/debug_connections.go:67
runtime.goexit
created by main.startConnectionTracking in goroutine 1
cmd/mo-service/debug_connections.go:65
Reachability and limits of attribution
The tested Linux-only file unconditionally starts connection tracking in init(), calls conntrack.Dial/Listen, and consumes events in a background goroutine. The recovered parent stack establishes the conntrack receive path, not a business SQL driver's cancellation path.
netlink v1.7.2 Receive calls Recvmsg with context.Background(). socket v0.5.1 rwT creates its watcher when a context has no explicit deadline. Normal I/O completion closes its done channel and also causes the watcher to exit: a user cancellation is not required. The source has one local wg.Add(1) and one deferred wg.Done() on this path. The panic alone does not establish double-Done, a dependency race, compiler fault, or memory corruption.
As inspected on 2026-11-01 CST:
- Current 4.2 head 382001d0 has byte-identical connection-tracking source and the same dependency versions. This proves source reachability, not reproduction on that newer head.
- Current main 1565fb79 calls startConnectionTracking unconditionally after flag/daemon handling. It has Listen-failure cleanup/ticker cleanup improvements and the same network dependency versions, but go.mod requests Go 1.27.1 rather than 1.26.4. This is not evidence of either a main reproduction or a fix.
Reproduction status and expected behavior
The failure was observed in the linked scheduled Family FullConcurrent run; no deterministic minimal reproducer or first-bad commit is established. No extra workload or shared-environment reproduction has been run for this report. Expected: background connection-tracking instrumentation must not terminate the CN during a supported concurrent workload.
Duplicate check
Current GitHub Issues API searches included open and closed issues for negative WaitGroup, mdlayher/socket, socket.rwT, debug_connections.go, eventWorker, and conntrack (all search responses report incomplete_results=false). No existing issue covering this exact panic path was found.
- #27048, closed: TAE tasks.Job.Run unit-test WaitGroup panic; different owner/path.
- #15730, closed: proxy.pipe.handleTransferIntent WaitGroup panic; different owner/path.
- #28347, closed: conntrack permission-denied bootstrap, not a negative-counter runtime panic.
- #31888, open: earlier 4.2 AP OOMKilled incident on a different tested revision/run; not evidence that this Error/134 panic is already covered.
Remaining evidence gap
The first process's exit cause is unknown. A bounded Loki keyword query of 22:47:16–22:52:16 UTC and a narrower lifecycle query around 22:49:46 found the new process's startup and the later panic, not an earlier fatal marker. Kubernetes lastState retains only the second process termination. Missing earlier fatal logs must not be interpreted as proof that the first termination was not an OOM.
Activity
MatrixAdventurer commentedon Nov 1, 2026
分级建议:severity/s-1
理由:4.2 AP CN 在 conntrack 后台接收路径整进程崩溃,属可用性故障;同域连接层历史问题均定 s-1(如 #27757)。若进一步定位确认为三方依赖自身缺陷,可酌情降档。
模块/目录:cmd/mo-service/debug_connections.go(conntrack 接入)及所引三方库调用链。
疑似重复:未发现;邻案 #28347(conntrack 自启权限报错,已完成)非同症状。
建议负责人:维持现指派 LeftHandCold(同族连接层问题惯常跟进人);代码侧可参考 debug_connections.go 近期提交者 iamlinjunhong。
——本操作由LW授权的MOI智能体提交
fix(conntrack): avoid socket watchers for background receives (#32845)
XuPeng-SH commentedon Nov 17, 2026
转 QA 做已合 main 修复的 field acceptance,保持 issue 开放;不是事故根因结案或验收通过。
关联 #32845 已合 main:
5294772e78a5a9b241f9732a59236db587f2b470(heade365ddc912f9e75c7184851fb0d504619dcc6057)。socket v0.5.1→v0.7.0 对 nil Done 的 Background receive 不再创建 cancellation watcher,移除事故栈所见的该 watcher 路径;conntrack 仍开启。没有确定性复现生产 negative WaitGroup counter,不能声称已证明 double-Done 或其最终根因。作者报告历史候选完整 cmd/mo-service normal/race 各 172 tests/subtests、3 个 socket contracts 各 100 race repetitions、隔离 network namespace 真 conntrack events/16-worker Close、conntrack 开启时 transaction/prepared/DDL BVT 两次各 135/135 和正常退出。评审 5688e56 独立验证 socket 3/3 normal、3/3 race 及各 100 次;v0.5.1 的 cancellation 控制失败、v0.7.0 通过,但那是 cancellation 缺陷而非生产负计数复现。更广 service/native/adapter 证据是作者报告和 frozen CI,不能冒称评审全量重跑。最终队列因 fork 编辑权限出队,不作为最终 CI 全绿证据。
请 QA 在含该 merge 的 main 构建上做长期、多 CN、真实 conntrack 开启的 Family concurrency/收发/取消/Close/退出验收,记录实际 SHA、Go/依赖版本、重启/退出原因、goroutine watcher 与错误日志;确认正常 SQL、连接复用及资源回收。原事故发生于 4.2-dev,本次仅 main 合入,不表示 4.2 已包含修复,不自动要求或执行 backport。早先第一个进程退出原因仍未知,不能据此排除 OOM。独立 #32851 event-order/retention 缺陷未修复,仍单独研发跟进。
已读完整 issue/PR 评论;此处待做的是 field acceptance,未发现适用于已合变更的当前已验证反例或其他明确未完成的本问题开发步骤。按持续转测流程改派唯一 @Ariznawlll,验收发现反例再凭具体版本/日志回转开发。本轮仅核对远端证据,未自行实测。
fix(conntrack): preserve connection lifecycle event order (#32854)
Ariznawlll commentedon Nov 24, 2026
结论
按转测约定的 main 事故专项 field acceptance 范围验收完成,关闭本 Issue:修复后的六个 1 TP + 2 AP Weekly Family 版本均保持真实 conntrack 开启,Shared resource health gate 全部通过,9 个 Pod 均 Running/Ready、restart=0;保留的 FullConcurrent 日志未再出现
negative WaitGroup、panic/fatal error 或 OOMKilled。这不是“Family 全部 SQL/性能用例全绿”,也不是对历史负计数最终根因的确定性重建。
修复与六轮版本
5294772e78a5a9b241f9732a59236db587f2b470。cmd/mo-service/main.go仍无条件调用startConnectionTracking(),没有通过关闭监控回避事故路径。go.mod为 socket v0.7.0:edaafb6668efdfabaedc71c3a4df90bd3aeeba3587c44445f83e308ef12dd7ca0e570cec1e6690d9d2e71035dbae7471052ca5c0034d05827b92624963e76cf7285bb2b35032d4c1e851f7f6b0699deff1ffbaaff35d8765f0fc1c5070cf22ba50e8ccdadea4f40b17d0893da6823fec1fdd27cf6493dea3并发与可用性证据
negative WaitGroup、panic:、fatal error或 OOMKilled。ALTER COPY ... source admission changed的 20601 冲突和清理超时,属于独立问题。本关闭只采纳 conntrack/socket 后台路径未再导致 CN panic/异常重启的证据,不把其他失败写成通过。例外与版本边界
45201321401有一个 AP CN OOMKilled、重启一次,且 FullConcurrent 被跳过;该事件由 [Bug]: AP CN native memory grows after Family AP workloads and reaches OOM limit #33118 独立跟踪。它不是 negative WaitGroup 复现,也没有被隐瞒或计为第六轮通过。