Workflow branch store and request-controller operation store grow without bound
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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
- フォーク
- 8
- 平均マージ
- 25分
- マージ済み PR(30日)
- 20
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Automattic/agents-api のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Automattic/agents-api#564 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
Automattic/agents-api#560 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Automattic/agents-api#552 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
Automattic/agents-api#551 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
Automattic/agents-api#550 ·
メンテナーはふだん 1 日以内に返信
Automattic/agents-api の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Awaiting Triage
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
WordPress/two-factor#1008 ·
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信