Skip to content

Keep interactive write retries within the busy-response budget - #86

Closed
jsflax wants to merge 2 commits into
mainfrom
fix/interactive-busy-write-budget
Closed

jsflax wants to merge 2 commits into
mainfrom
fix/interactive-busy-write-budget

Conversation

@jsflax

@jsflax jsflax commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

The interactive writer could admit three full two-second BEGIN waits plus backoff, consuming about 6.4–6.5 seconds before response overhead. The existing persistence integration requires a busy response in under six seconds; a recorded request returned the expected busy error in 6.579 seconds and failed that check.

The fix lowers only the default retry-admission cap from 6.5 to 4.5 seconds. Two full two-second attempts plus their first backoff fit; a third full wait is refused. Short-timeout retries retain three attempts. The maximum attempt count, per-attempt timeout, custom caps, exact contention classification, no-replay rule after a body starts, and busy response format remain unchanged. The separate durable-operation ledger policy is outside this request path and remains unchanged.

A deterministic regression uses a real independent SQLite transaction to hold the write lock. Actual failed-BEGIN callbacks advance a logical clock by the configured timeout; injected backoffs advance that clock without sleeping. The two-second case requires two attempts and no mutation; a 100 ms control requires three attempts. Both verify successful checked writes after releasing the holder with the same configuration.

At test-only head 83380a3f43c32b36fbdba8f09bbb29d795a11dfe, Linux attempt 1 compiled and failed exactly the new two-second case: three attempts instead of two, both backoffs, and 6.4 logical seconds instead of 4.1 (five issues). The 100 ms case reported no issue. The test is unchanged in the product-fix commit.

This is an admission bound, not a hard deadline for scheduler pauses, embedding, successful transaction work, or response transport. The existing end-to-end six-second assertion remains the integration gate. No test threshold or workflow changed.

Validation at 49089e297d1d9ad1fbf44af9e0a60112bba9e514:

Automatic check, attempt 1 Result
Linux All 99 declarations / 107 expanded cases in 22 suites pass; no issues or runtime skips. Both unchanged regression cases pass.
Native Compiles. All seven MCP cases pass, including the unchanged persistence bound: busy response 4.321 s < 6 s, rejected write absent, successful recovery, two process reopens and three clean exits. The job is red for the separate admission assertion described below.

Native's only issue is SpawnAdmissionResourceTests.darwinCPUAndMemoryPressureRefuseWithoutTimestampOrLaunch, line 86: expected resource-unavailable admission, received concurrency refusal because a shared lifetime lease was held. No rerun or waiver is claimed. The broad selection reports 811 declarations: 796 pass (890 expanded passing cases), one fails, 14 framework skips. Four benchmark declarations counted as passes returned early because fixture inputs were absent. All six later serial invocations pass (10, 1, 1, 1, 1, 1 declarations); these are separate invocations, not additional unique tests.

The new backend regression executes on Linux and is only compiled by native validation. Native's existing retry tests and actual MCP integration execute. The optional read-visibility check in the warm-multistore MCP case remains unverified. Source, lockfile, SDK mirror and all 43 dependency checkout pins are unchanged in the native receipt.

Syntax and whitespace checks pass. No workflow or test threshold changed; no local runtime result or rerun is claimed. This draft is not an all-green native qualification.

jsflax and others added 2 commits November 15, 2026 12:07
Exercise real checked-BEGIN contention with the interactive timeout and a
short-timeout control. Advance logical time from actual failure callbacks
so the admission assertions do not depend on scheduler timing, and verify
that a refused write leaves no row and the same handle recovers afterward.

Co-Authored-By: Codex <noreply@openai.com>
Reduce the default BEGIN retry-admission budget to 4.5 seconds so the
interactive two-second timeout cannot admit a third full wait. Preserve
short-timeout retries, custom budgets and the no-replay transaction fence.

Co-Authored-By: Codex <noreply@openai.com>
@jsflax

jsflax commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Consolidated in #88 (reserving interactive busy-write retry headroom within the 6s budget).

@jsflax jsflax closed this Nov 17, 2026
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