Repository navigation
fix: avoid masking query errors after connection close - #455
Closed
dajiaohuang wants to merge 1 commit into
Closed
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
Owner
|
Thanks for the PR, but the fix there only avoid they |
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.
Closes the
KeyErrorpath described in #449: the connection close handler clearsconn.info, whileafter_cursor_executemay still run and unconditionally popquery_start_time. When it is absent, skip recording latency rather than raising a new exception that masks the original query failure.The regression test dispatches the real SQLAlchemy before/close/after events on a synthetic connection. Normal in-memory SQLite query latency remains covered by the existing database tests.
This addresses the reported exception-masking defect only; it does not establish or claim a fix for the unconfirmed SIGSEGV. The open #451 event-loop invalidation change is separate; current
mainalready dispatches invalidation through its timeout executor.Validation:
tests/db_test.py -k 'not test_connect_error'passed (46); targeted regression passed; Ruff check/format andgit diff --checkpassed. Full unit suite on Windows had two unrelated failures in tests that expectsqlite:////invalidto fail; Windows SQLite accepts that path. The rest passed (233).