feat(worker): 集群档取消传播止步步界——execution.cancel() 即时取消件已存在但无跨进程触发路径
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, redis
- Domain
- backend, distributed-systems
Research direction
Start with flow_worker.py and control.py to trace worker lease ownership and custom command handling, then read the cancellation path in executions.py and the FlowExecution.cancel() implementation in executor.py. The issue’s acceptance check is that cancelling a running long AGENTRUN kills its process group within 5 seconds and ends in the cancelled state.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无
基线 HEAD = ddcedae。
Summary
_cancel_requested全部调用点只有三处:start 入口(flow_worker.py:791)、resume 入口(:920)、步界(:1139)——没有任何步内/节点内轮询。- 引擎侧即时取消件已具备:
FlowExecution.cancel()(executor.py:167-183,cancel_event + 粘滞 cancel_requested;runner.py:276-284 节点入口拒执行、code 沙箱 killpg)——但 worker 内唯一调用者是看门狗失租(:1598-1630)。 - 控制通道具备定制命令能力:
ControlListener.register_handler(control.py:97-99),但RedisFlowWorker从未注册 cancel handler;console 控制面只发stop(plaita-console/backend/api/services.py:530-548)。BFF cancel 只写标志键 + 入队 resume 消息(executions.py:600-633)。 - flow_worker.py:1136-1138 注释宣称「code 沙箱类由引擎层 cancel_event 即时击杀」——但用户取消链路上没有任何代码把标志键翻译成
execution.cancel(),该宣称当前不成立。
影响
用户对运行中的数小时高成本 AGENTRUN 点取消:API 返回成功、标志键写入,但 worker 要等这个节点自然跑完才在步界消费标志——全额成本照烧、副作用照发,取消意图延迟数小时兑现。
建议
最小闭环(纯接线不改引擎):worker 注册 control 自定义命令 cancel_execution(查本 worker 持有租约的 execution → execution.cancel()),BFF cancel 时向持有者广播;标志键仍是兜底真相源。
验收:运行中长 AGENTRUN 点取消,断言 5s 内进程组被击杀、终态 cancelled。
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 3h 53m
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jeffkit/plaita
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
UKGovernmentBEIS/inspect_ai#5802 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
no-human-ai/no_human#660 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
documentation need help question
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
phonology024/babelscribe#26 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100