Repository navigation
FIX: SQLite analytics timeouts - #3065
Open
Roman Lutz (romanlutz) wants to merge 1 commit into
Open
Roman Lutz (romanlutz) wants to merge 1 commit into
Roman Lutz (romanlutz) wants to merge 1 commit into
Conversation
Retry plain SQLITE_BUSY reads and report setup asynchronously within the existing request deadline instead of using native SQLite busy sleeps. Preserve the read transaction, non-busy errors, and SQL Server behavior. Drain connection-setting restoration under repeated cancellation and discard connections when reset fails. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Description
SQLite's native busy timeout accumulates requested sleep durations rather than enforcing an absolute deadline. This can make analytics lock waits outlast their shared request budget. The existing lock-wait test failed both on pre-PR
mainand during the second merge-queue attempt for #3048; the failures were not caused by that PR's changes.SQLITE_BUSYreads and consistent-report setup with paced asynchronous waits against the existingQueryControldeadline.Existing deadlines, assertions, and coverage thresholds are unchanged. Retries add wakeups and do not provide a real-time guarantee when the OS deschedules the process. This addresses the verified lock-wait limitation, not the separate first macOS report timeout, whose historical cause remains undetermined.
This is complementary to the SDK work in #3059: the SDK owns admission and response capacity, while the reader owns database retries and cleanup. The public methods and result shapes are preserved, but the combined SDK branch has not been tested.
Tests and Documentation
Added regression coverage for lock release, deadline expiry, bounded retry sleeps, cancellation, repeated cancellation during cleanup, connection reset failures, all analytics projections and report setup, non-retryable errors, and unchanged SQL Server behavior. Updated the memory-models guide to describe the retry and cleanup policy.
Windows / Python 3.12.13, using this worktree's uv-managed environment. Explicit invocation through
uv run --no-projectavoided a local uv interpreter-discovery stall.Parallel analytics and SQLite cancellation suites with sysmon coverage:
Result: 226 passed, with 93% focused module coverage. Two additional regression cases were subsequently added without changing production code.
Final new regression suite:
Result: 41 passed.
Original deadline bound, consistent-report snapshot, and ODBC timeout regressions:
Result: 5 passed, 119 deselected, with original assertions unchanged.
All applicable commit-time hooks passed, including Ruff, repository-wide production typing, async naming, and documentation structure validation. No hooks were skipped.
Full-repository tests, live Azure SQL, macOS/Ubuntu execution, and combined validation with #3059 were not run. Local coverage is not a production latency claim or a full-repository coverage gate.
JupyText was not run: this changes Markdown documentation, not paired Python/notebook examples.