Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#562 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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
フォーク
8
平均マージ
25分
マージ済み PR(30日)
20

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/agents-api のほかの issue

Automattic/agents-api の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。