Skip to content

Accept published PHP health read during or after its own task repair - #676

Merged
rmcdaniel merged 2 commits into
mainfrom
rust-325-opmetrics-repair-window
Oct 23, 2026
Merged

rmcdaniel merged 2 commits into
mainfrom
rust-325-opmetrics-repair-window

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Fixes a flaky operator-metrics difference in Shared Server fixtures. It comes from the published PHP reference, not native. Main's latest postgres-17 run (39815830012) failed this way, and so did train #675's (120010743834). In both, no PHP pass line precedes the difference.

Why PHP differs from itself. The probe reads system/operator-metrics, then system/health, in two requests. Past the redispatch window, PHP's TaskWatchdog::recoverExistingTask repairs the overdue task and projects the run in one transaction. Only after that commit does TaskDispatcher::dispatch set last_dispatched_at and project the run again. A health read in between sees the task still overdue and the run projected repair_needed, so durable_resume_paths warns. A read after the redispatch sees task_transport and routing_health clear. The contract already accepted metrics taken after the repair (REPAIRED), but assumed health matched the metrics' state.

Change. For runtime: php at waiting_after_redispatch only, health may be at the metrics' state or at a later point of that repair. The order is overdue, then repairing, then redispatched. Health behind its metrics is still rejected. Native runs no repair loop and is held to exactly the state its metrics show.

Tests (ServerParityOperatorMetricsContractTest.mjs, 40/40): PHP health mid-repair passes, and PHP health after the redispatch passes. Each of these is rejected: native showing either state, PHP health behind metrics that show the redispatch, and the repair warning at another stage. Against main's contract, exactly the two new PHP cases fail.

The operator metrics probe reads metrics, then health, in separate
requests. Past the redispatch window, published PHP's TaskWatchdog
repairs the overdue task and projects the run before TaskDispatcher
redispatches it and projects the run again. A health read in between
sees the run needing repair (durable_resume_paths); one after it sees
the task redispatched. Both are later points of the same PHP repair,
not differences from the metrics read before them.

For PHP at that stage only, health may now be at the metrics' state or
a later point of the repair. Native runs no repair loop and stays held
to exactly the state its metrics show. Main's postgres-17 fixtures
failed this way on the published PHP reference (run 39815830012).
This PR's own postgres-17 run caught published PHP's metrics inside the
repair window: the task repaired once and still overdue, and the run
projected as needing repair (runs.repair_needed and
backlog.repair_needed_runs 1). The contract now models PHP's three
states past the redispatch window in order, overdue, repairing and
redispatched, each with its counts and warnings. With a repair count,
PHP's metrics may show repairing or redispatched; health may show the
metrics' state or a later one. Native still has only the state its
metrics show, and a run needing repair without a repaired task fails.
@rmcdaniel

Copy link
Copy Markdown
Member Author

Pushed d00461537. The previous head's own postgres-17 job caught published PHP's metrics inside its repair window, not just its health. The task had been repaired once and was still overdue, and the run summary was already repair_needed (runs.repair_needed: 1). The contract now models PHP's three ordered states past the redispatch window: overdue, repairing and redispatched. Each state carries its counts and warnings, and health may not be behind its metrics. Native is still held to a single exact state. Tests: 45/45. Against main's contract, the four new PHP-window acceptance cases fail as expected. One new rejection case also fails there, only because main already rejects at the counts step. The other jobs' differences on that head were the known signals-before-worker (native follows Server 2.10.0) and the PHP SQLite schedule-policies lock flake that #674 fixes.

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Merged into the #675 train at 6a4daa446. The train also carries the 2.11.1 reference move (#679), without which the MySQL and PostgreSQL fixture jobs fail on signals-before-worker. This PR closes when the train lands.

@rmcdaniel
rmcdaniel merged commit 6a4daa4 into main Oct 23, 2026
21 of 27 checks passed
@rmcdaniel
rmcdaniel deleted the rust-325-opmetrics-repair-window branch October 23, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant