Workflow branch store and request-controller operation store grow without bound
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
调研方向
Examine the WP_Agent_Workflow_Branch_Store class and the request controller's operation store to understand their storage mechanisms. Look for the TTL_SECONDS constant and the forget_run() method. Identify where a sweeper could be added, perhaps via Action Scheduler. For the request controller, find the option key and operation array structure to implement pruning or splitting.
由索引模型根据 Issue 内容生成。
描述
Problem
Two workflow stores grow without bound on a long-lived site. On a primary-mode Markdown-backed install used daily, after about two weeks:
WP_Agent_Workflow_Branch_Storeoptions are never swept.- 5,453 options accumulated:
agents_wf_branch_*3,247,agents_wf_branch_ctx_*1,013,agents_wf_branch_index_*1,013,agents_wf_branch_admission_*180. The oldest is from 11 days earlier. - Rows carry
expires(TTL_SECONDS = 7200), but expiry is only honoured on read. Rows are deleted only byforget_run()/forget_reconcile_receipt()when a run terminalizes, so any run that never resumes (stranded branches, crashed workers, a queue that stopped draining) leaves its rows forever.
- 5,453 options accumulated:
- The request controller's operation store has no retention.
- All operations for one controller key live in a single option. For one consumer's key it reached 9.9 MB.
- That option is rewritten on each operation transition. On that backend, a write of this size measured about 1.5 s and a read about 48 ms, on every search the consumer runs.
Both costs scale with option count and size on any backend; they're just most visible on file-backed storage.
Suggested direction
- Branch store: a bounded sweeper (for example, on the existing Action Scheduler recurring hook, or piggy-backed on dispatch) that deletes rows whose
expireshas passed and whose run is terminal or unknown. - Request controller: prune terminal operations past a retention window (and/or cap the count), and consider one option per operation, or a table, instead of one ever-growing array.
Related: storage-side latency fixes in Automattic/markdown-database-integration#429 make these writes cheaper, but don't remove the growth.
AI disclosure: measured and written up by Claude (Anthropic) via OpenCode/Kimaki at Chris Huber's direction.
- 主要语言
- PHP
- 星标
- 33
- 派生
- 9
- 平均合并
- 36 分钟
- 30 天内合并 PR
- 13
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Automattic/agents-api 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
Automattic/agents-api#564 ·
维护者通常 1 天内回复
-
难度 4/5 1-2 天 新手友好度 48/100
Automattic/agents-api#587 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
Automattic/agents-api#584 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 65/100
Automattic/agents-api#560 ·
维护者通常 1 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 45/100
Automattic/agents-api#552 ·
维护者通常 1 天内回复
查看 Automattic/agents-api 的全部 Issue
相似的 Issue
-
Add TuneIn-DirMon in the bot list可能已有人在做 @liviuconcioiu 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
matomo-org/device-detector#8424 ·
维护者通常 1 天内回复
-
affecting 5.2 only affecting 5.3 only bug
难度 2/5 1-3 小时 新手友好度 82/100
moodle-an-hochschulen/moodle-theme_boost_union#1463 ·
维护者通常 1 天内回复
-
Course help wanted Sensei
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 72/100
woocommerce/woocommerce-paypal-payments#4838 ·
维护者通常 1 天内回复
-
sync-en
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 2 天内回复