Files
gflow-engine/service
fnoopv 1ca02aab3c fix(service): serviceTask 函数名校验器读写加锁,消除数据竞态
serviceFunctionChecker 是进程级可注册运行时状态,写侧在宿主装配
(components.Register → SetServiceFunctionChecker)注入,读侧在 Deploy/Update
请求处理路径(ValidateChainExpressions → validateServiceTaskFunction)并发执行。
原来直接读写包级函数变量、无同步:宿主运行中重装配组件或测试并行 Set/读时,
go test -race 会报数据竞态,读侧可能拿到半装配状态的函数指针。

补 sync.RWMutex:
- SetServiceFunctionChecker 写锁写入
- 读侧经 serviceFunctionCheckerForRead 读锁读取
与同包 DefaultIDGenerator(defaultIDGenMu)和 DialectRegistry(mutex)等
可注册运行时单例的并发安全口径对齐。

新增 ConcurrentAccess 用例(并发 Set/读,go test -race 下验证无竞态)。
2026-09-08 14:54:05 +08:00
..