Skip to content

Keep SQLite claim and acknowledgment waits inside their retry budgets - #838

Merged
rmcdaniel merged 5 commits into
mainfrom
fix/sqlite-admission-wait-budget
Oct 17, 2026
Merged

rmcdaniel merged 5 commits into
mainfrom
fix/sqlite-admission-wait-budget

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

The published four-worker follow-through in #837 completes all callbacks exactly
once, but its diagnostic original retains a failed Laravel delivery after real
SQLite error 5 at the initial activity-claim writer admission. The original root
rolled back before any callback. This is distinct from the published summary
correction in #835 and does not establish a historical shared cause.

SQLite's normal 5,000 ms busy timeout can consume the helper's complete existing
five-second admission budget in one call, leaving no bounded root retry. The new
real two-PDO regression covers workflow and activity claims with shared and
separate application storage. Its competing writer releases only after the
original root rollback is independently observed.

The correction bounds individual admission waits to at most 100 ms within the
existing total budget and restores the connection setting before entering the
operation, also restoring it on refusal. It preserves
the root/PDO rollback proof, body-once semantics, original claims/deadlines, nested
and non-SQLite behavior, uncertain commit/rollback refusal, and callback outcomes.
No repair-policy or clean-consumer assertion relaxation, version, schema or
Server/shared/native change is included. All earlier failed originals retain
their outcomes.

The exact-parent counterfactual fails all four new real two-PDO controls
(4 failures / 28 assertions), each retaining one failed Laravel job before claim.
The correction passes all four unchanged controls (4 tests / 68 assertions),
with one first-attempt callback and completion, zero repairs or failed jobs,
preserved history/deadlines and the original 5,000 ms connection setting restored.
The admission implementation also passes all 70 focused transaction, embedded
task and projection controls (1,027 assertions). The subsequent specific
admission-setting refusal and its unit suite pass 28 tests / 126 assertions,
with ECS fix followed by a clean check and PHPStan passing. Source CI remains
pending. The previous hosted formatting failure is preserved and corrected.
Sonar's new generic-exception finding was addressed with a specific
SqliteWriteWaitException, rather than changing its rule or threshold; fresh
analysis must confirm resolution.

The existing outcome test still holds a genuine writer for over five seconds
within the original claimed outcome deadline. Its release now follows that
elapsed boundary across short waits, so it continues to prove that the callback
runs once and an already executed outcome can outlive the ordinary admission
budget without renewing its original claim.

A separate source four-worker original 01m55rw0a6cpfdz9tj2fh4v22h on PHP 8.5.6 /
SQLite 3.51.2 completes all 64 first-attempt callbacks and preserves typed output,
prefix and original deadlines, with zero failed jobs. It nevertheless FAILS
the unchanged clean guard: one reserved-row repair and one reserved transport row
remain after a real SQLite5 at the original fenced acknowledgment DELETE.
This is a newly identified retry-budget boundary in that existing acknowledgment
helper, not a successful clean-consumer run or a callback failure. Its transaction
has rolled back and no commit uncertainty is inferred. Two new two-PDO controls
will reproduce that specific acknowledgment boundary before correction. The
conditional reservation fence and refusal of uncertain acknowledgments remain
required. Original failed records are not relabeled.

Both new acknowledgment controls fail on the prior queue implementation
(2 errors / 6 assertions). The correction shares the bounded driver-wait scope
with the existing fenced DELETE, while retaining that helper's independent
five-second / 64-attempt limits and original root/PDO/SQL/bindings proof. Nested
and non-SQLite acknowledgments retain their previous path. The handler is never
rerun. All 42 acknowledgment and transaction controls now pass (202 assertions),
including changed reservations, changed PDO, constraints and uncertain commit or
rollback refusals. ECS and PHPStan pass. A new four-worker original and fresh
whole-source qualification remain required.

Final source 46d620ea passes a new four-worker original
01m55s3z50frt10e5hfbc957xt under the unchanged 2-CPU / 2-GiB / no-swap limits:
64 exact first-attempt callbacks/activities, 66 completed tasks, one workflow
completion, original prefix/deadlines and exact typed output. Repairs, failed
jobs, remaining deliveries and delivery exceptions are all zero. All four real
worker roles finish and the original 90-second observer passes. The captured
pre-update repair intents do not become durable repairs. This is PHP 8.5.6 /
SQLite 3.51.2 source acceptance, separate from the stock hosted PHP 8.3 published
consumer. No installed 2.5.32 claim is made. No acceptance assertion was relaxed.

Sonar's subsequent complexity report is addressed by a private conditional-write
method, leaving the complete rollback proof together. That extraction passes all
14 acknowledgment controls / 76 assertions, ECS and PHPStan. Final source
a3770d77 is awaiting its normal PR checks. Fresh Sonar analysis and the app
check pass, with zero OPEN or CONFIRMED issues and both S112 and S3776 explicitly
CLOSED/FIXED. No rule, threshold or exclusion was changed. The earlier full
56fc1d86 run has passing database shards, coverage and five actual SQLite
upgrade profiles, but its formatting failure and failed aggregate remain.
Those component results do not qualify the final whole tree. Exact automatic
main qualification is required after merge and before publication. Compatible
stable candidate #839 has identical affected runtime/tests and its own full
qualification, separately from published consumer #837.

Merged at 8f55cdfb with identical whole tree 8f74fa2f and exact parents
d463158b / a3770d77. All applicable final PR checks pass. The remote merged
head is absent. Automatic fresh-main 39068134874 is pending and will qualify
that exact merge before publication. Normal installed 2.5.31 also independently
reproduces all six controls (four failures / two errors / 34 assertions), with
all 937 installed runtime/resource files matching its immutable release.

@rmcdaniel rmcdaniel changed the title Keep SQLite writer retries inside the original claim admission budget Keep SQLite claim and acknowledgment waits inside their retry budgets Oct 17, 2026
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel marked this pull request as ready for review October 17, 2026 20:46
@rmcdaniel
rmcdaniel merged commit 8f55cdf into main Oct 17, 2026
18 checks passed
@rmcdaniel
rmcdaniel deleted the fix/sqlite-admission-wait-budget branch October 17, 2026 20:46
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