修复: B-03b-R1 取消节点跳 set_failed + R2 取消测试(补完 B-03b 复核)

R1: executor Err 处理加 is_cancelled 检测,已取消节点跳 set_failed(Cancelled→Failed transition 非法会 bail 致工作流崩溃),状态保 Cancelled,emit NodeFailed 仍发
R2: test_cancelled_node_skips_set_failed 验证取消传播链(CancelSelfNode 共享 node_status 自取消→Err→executor 不 bail→状态 Cancelled)
补完 B-03b 端到端:4aa689e 只通 IPC→set_cancelled→HumanNode→Err 链,漏验 HumanNode→executor Err 处理与 Cancelled 冲突;df-workflow 14 test pass
This commit is contained in:
2026-06-14 16:10:10 +08:00
parent 406b9216de
commit d6cd2805be
2 changed files with 58 additions and 4 deletions

View File

@@ -55,8 +55,8 @@
> B-03b 端到端补完commit 4aa689e后独立复核发现 2 加重 + 3 低优。**①为真实 bug**:取消链 IPC→set_cancelled→HumanNode is_cancelled→Err 通了,但 HumanNode 返 Err 后 executor run:115 `set_failed` 走 transition而 Cancelled 不在 `is_legal` 转换图 → bail → 工作流因状态转换错误异常终止(非优雅标记取消)。补完时只验 IPC→HumanNode 链,漏验 HumanNode→executor Err 处理。
- [ ] B-03b-R1 **[P1]** Cancelled 未纳入转换图双踩executor Err 处理 `set_failed(node)` 在节点已 Cancelled 时 `transition(Cancelled→Failed)` 非法 bail。修法二选一A. `is_legal` 加 Cancelled 为终态Cancelled→Failed/Completed 合法或显式拒绝并特殊处理)/ B. executor Err 处理先 `is_cancelled` 检测,已取消则跳过 set_failed 改 emit 取消事件。推荐 B取消语义清晰不动转换图)
- [ ] B-03b-R2 **[P1]** 零端到端取消测试 — clone_shares 仅验共享语义,缺 IPC set_cancelled→HumanNode is_cancelled 命中→Err→executor 处理 全链测试;测试夹具不支持共享 StateMachine 验证(需构造共享实例 + 并发 set_cancelled
- [x] B-03b-R1 ~~Cancelled 转换图双踩~~ ✅ 已修(executor Err 处理加 is_cancelled 检测,已取消节点跳 set_failedCancelled→Failed 非法 transition 不再 bailemit NodeFailed 仍发,状态保 Cancelled采修法 B 不动 is_legal 转换图)
- [x] B-03b-R2 ~~零端到端取消测试~~ ✅ 已补test_cancelled_node_skips_set_failedCancelSelfNode 经共享 node_status 自取消→Err→executor 不 bail→状态保 Cancelleddf-workflow 14 test pass
- [ ] B-03b-R3 — **[P2 低优]** std::sync::Mutex 取舍 — 当前选 std快速临界区纳秒级若 async 持锁场景增多评估换 tokio::sync::Mutex
- [ ] B-03b-R4 — **[P2 低优]** set_* 改 &self 后调用方残留 &mut 冗余清理
- [ ] B-03b-R5 — **[P2 低优]** `lock().expect()` poison panic 漏清理poison 时直接 panic 无优雅降级)