Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Workflow branch store and request-controller operation store grow without bound

已关闭
#562 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php, wordpress
领域
backend, databases

调研方向

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:

  1. WP_Agent_Workflow_Branch_Store options 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 by forget_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.
  2. 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 expires has 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Automattic/agents-api 的其他 Issue

查看 Automattic/agents-api 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。