Repository navigation
fix: 修复后台唤醒回合的运行状态误判 - #316
Merged
Merged
Conversation
现象 Worker 派单唤醒的回合已执行 20 分钟后,运行列表变为空闲,工具仍在执行。 根因 后台唤醒回合缺少可供活性判定的任务登记。轮询回退到启动时间,把超过阈值的登记当作泄漏。 修复 按会话和回合 ID 登记唤醒任务。活性判定先检查匹配的任务是否尚未结束。回合退出时清理登记。 验证 真实派单入口回拨 1205 秒,API 与活性判定回归在撤回修复后失败。恢复后 177 项相关测试及 ruff 通过。
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
现象 CI 的 /compact 用例发现已有预登记的回合被识别为可压缩。 根因 新增活性检查把登记缺失与已登记空值合并成了同一种情况。 修复 按会话键读取登记,明确处理键缺失,保留预登记的忙碌判定。 验证 /compact 原回归、Worker 唤醒和僵尸清理在内的 210 项相关测试通过。Ruff 通过。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现象
Worker 派单后台唤醒的回合执行超过 20 分钟后,侧栏显示空闲,后台仍继续发送工具帧。
根因
唤醒回合由调度器执行,活性判断拿不到桌面
_TURN_TASKS条目。/api/running回退到启动时间,把超过阈值的运行登记当作泄漏清除。修复
按会话和回合 ID 记录执行唤醒回合的任务。
running_turn_alive()在检查过期时间前确认该回合的任务是否仍在执行。唤醒结束时释放登记,停止看门狗仍按现有回合登记收敛。已结束或属于旧回合的任务无法阻止僵尸清理。预登记的忙碌判断仍以会话键是否存在为准。验证
assign_to_worker(..., async_delivery=True)唤醒入口,启动时间设为 1205 秒前。/api/running与/api/badge在任务执行中维持运行状态,执行结束后清空。/compact忙碌保护。ruff check .通过。