Repository navigation
fix(db): a lease released after an interrupt does not touch the entry that replaced it (#1213) - #1219
Merged
Merged
Conversation
… that replaced it (#1213) A lease kept only the pool key, so releasing a lease taken before an interrupt decremented the entry created after it under the same key. The replacement's refcount then reached zero while still in use, and the idle timer disconnected the session under its user. A lease now holds its entry, and release does nothing for an entry that is no longer in the pool. Applied to the PostgreSQL, MySQL and SQLite pools, with a test in each.
ZhuchkaTriplesix
force-pushed
the
fix/1213-lease-release-identity
branch
from
October 9, 2026 09:14
7bd4dd2 to
8a17e9e
Compare
Grid scroll benchmark
Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result. |
3 tasks
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 #1213
What was wrong
A lease kept only the pool key. After
interruptremoved an entry, a lease taken before it still released by key, which found the entry created afterwards and decremented its refcount. The replacement could reach zero while in use, and the idle timer then disconnected the session under its user, withNot connected to …on the next statement.Changes
_PoolEntry; entries know their key._releaseignores an entry that is no longer in the pool under its key, and the idle timer checks the same identity before disconnecting.Not verified locally
Tests were not run locally, per the project rule. CI runs the three new tests.