fix: bound pathless batch action lookup - #3083
Merged
Merged
Conversation
Member
Author
|
Follow-up repair pushed in
Verification:
The remaining test red described by CI is the malformed empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LIKEscan with an exact lookup using the canonicalparent_job_id+ durablebatch_state.offsetidentity stored in Action Scheduler's indexedargscolumnhook_status_scheduled_date_gmtindexIndexed and bounded strategy
BatchScheduleralready produces a complete action identity:parent_job_idandoffset. The durable batch state supplies the expected offset, while Action Scheduler stores the short canonical JSON in its indexedargscolumn. The primary lookup therefore uses exactargs, hook, and active statuses withLIMIT 101instead of introducing another identity table or scheduler abstraction.Historical #3065 argument shapes cannot all be represented by one exact indexed key. Their compatibility path queries pending and in-progress rows separately, following Action Scheduler's existing
(hook, status, scheduled_date_gmt)index. Each query returns at most 100 inspectable rows plus one sentinel row.Absence-proof semantics and compatibility
The existing boolean API remains compatible with its sole caller.
truemeans recovery must skip because active work exists or because bounded evidence cannot prove absence. A truncated exact/compatibility window or query error therefore returnstrue; only exhausted exact, pending, and in-progress evidence can returnfalse. This preserves the caller's fail-closed behavior without adding an incomplete-evidence state it does not need to distinguish.Exact parent decoding remains unchanged for keyed JSON, nested JSON, keyed serialized, and nested serialized arguments. Freshness handling for in-progress rows and unconditional pending protection are also unchanged.
Query cardinality
The regression fixture models 10,000 unrelated actions and verifies that only the 101-row bounded result is materialized and truncation fails closed.
Tests
php tests/pathless-batch-recovery-bounds-smoke.php(13 passed)php tests/recover-stuck-active-action-guard-smoke.php(18 passed)php tests/recover-stuck-bounded-apply-smoke.php(16 passed)php tests/recover-stuck-bounded-memory-smoke.php(13 passed)php tests/prefix-policy-audit.php(11 passed)Baseline limitation
The local Homeboy test umbrella and focused
PipelineBatchSchedulerTestinvocation both reported zero executed tests before loading PHPUnit. This is test-discovery infrastructure rather than a test failure; focused behavioral and caller smokes above executed successfully. PR CI should provide the repository's configured WordPress PHPUnit environment.No production recovery, mutation, release, deployment, version bump, changelog edit, or parallel scheduler abstraction was added.
Closes #3077