修复 VM 空闲回收活动语义并统一回收流程#868
Open
yokowu wants to merge 7 commits into
Open
Conversation
Collaborator
Author
|
关联变更: |
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.
背景
control WebSocket 保活曾被当作真实任务活动,持续刷新 notify/recycle deadline 和
tasks.last_active_at,导致长连接任务长期无法按默认周期回收。旧 Redis 数据中还存在大量缺少 recycle deadline 的 VM,需要安全区分可回收、待修复和孤儿状态。此前拟通过持久化
task-event补齐活动日志,但task-event只承载文件、端口等临时环境事件,没有必要写入任务日志。本方案不修改 taskflow。改动
KeepAwake与RecordActivity,并使用独立 debounce keytasks.last_active_at,也不延长提醒与回收时间last_active_at与 VM 回收计时;拒绝的输入不刷新last_active_atmax(created_at, last_active_at)与 Redis recycle deadline 分析 VM,不再查询 ClickHouse/Loki,也不依赖task-event入库candidatedeadline_missingorphanhistorical_uncertainDeadlineRepairer,执行时重新校验非终态任务与当前团队策略,并按now + EffectiveRecycleSeconds重建 deadlineEnqueueIfMissing,通过 Lua 原子检查 ZSET member;并发活动已创建 deadline 时不会覆盖vmrecycle.Recycler,供自动 consumer、lifecycle hook 和运维 CLI 复用验证
GOWORK=off go test ./...GOWORK=off go vet ./...git diff --check新增/更新测试覆盖:终态与非终态缺失 deadline、未来 deadline、孤儿扫描、当前策略重校验、并发 deadline 不覆盖和延迟队列原子入队。
依赖
monkeycode-ai MR !750 将 submodule 更新到本 PR,并提供只读扫描、显式回收及 deadline 修复 CLI。本方案不依赖 taskflow 改动。