Skip to content

Retry the documented poll lock-pressure refusal in every parity probe - #511

Closed
rmcdaniel wants to merge 1 commit into
mainfrom
rust-325-probe-lock-pressure
Closed

rmcdaniel wants to merge 1 commit into
mainfrom
rust-325-probe-lock-pressure

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Part of #325.

#508's shared run failed in execution-and-codec, step "Execute and compare Rust, published PHP and embedded fixtures", while recording fixtures against the published PHP SQLite reference:

DurableWorkflow\Exception\ServerException: The database backend is under lock pressure while claiming a task. Retry the poll with backoff; …

That is the documented 503 backend_lock_pressure refusal (task: null, retryable). The PHP reference shares its SQLite file with the maintenance loop, and SQLite refuses a deferred writer at once, without waiting out its busy timeout, while another connection writes. #478 already honored this refusal in restart.php. The fixture probes still called the SDK's poll directly and treated it as fatal.

parityClient() (in lock-pressure-transport.php) now builds every SDK client in:

  • probe.php, and the probe files it loads;
  • cooperative-restart.php.

It keeps any transport the caller passes and wraps it with the same bounded retry as restart.php: only that refusal on a POST poll, at most 15 retries and 30 s. Retries are reported on stderr when the process exits, so recorded observations stay comparable across PHP, native and embedded targets. The failure-evidence reader in probe-failure.php keeps its plain client and 1 s timeouts.

Check

With the parity SDK installed as CI installs it, a small script built a parityClient() around a transport that refuses the first two polls. The poll succeeded on the third call through the caller's transport, and both retries were printed on stderr. All changed files pass php -l. The existing ServerParityLockPressureRetryTest covers the retry decision itself.

🤖 Generated with Claude Code

#508's shared run failed while recording against the published PHP SQLite
reference: an SDK poll in a probe received the documented 503
backend_lock_pressure refusal (task null, retryable) and the probe treated
it as fatal. SQLite refuses a deferred writer immediately, without its busy
timeout, while the maintenance loop writes. #478 already honored that
refusal in restart.php.

parityClient() now builds every SDK client in probe.php, the probe files it
loads and cooperative-restart.php, keeping any transport the caller passes
and wrapping it with the same bounded retry. Only that refusal on a POST
poll is retried. Retries are reported on stderr at exit, so observations stay
comparable across targets. The failure-evidence reader keeps its plain
client and short timeouts.

A local check with the installed parity SDK: a poll refused twice succeeds
on the third call through the caller's transport, and both retries are
reported.

Part of #325.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

Folded into #501 (commit 361c903), so both CI reliability fixes qualify in one shared run.

@rmcdaniel rmcdaniel closed this Oct 20, 2026
@rmcdaniel
rmcdaniel deleted the rust-325-probe-lock-pressure branch October 20, 2026 05:12
@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants