Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado
#562 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
php, wordpress

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
PHP
Estrellas
33
Forks
8
Merge medio
25 min
PR fusionados (30 d)
20

Preparar el entorno

Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Automattic/agents-api

Todos los issues de Automattic/agents-api

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.