Check SQL refresh throttle before discarding the connection pool - #11730
Open
SwaroopKolasani wants to merge 1 commit into
Open
Check SQL refresh throttle before discarding the connection pool#11730SwaroopKolasani wants to merge 1 commit into
SwaroopKolasani wants to merge 1 commit into
Conversation
This was referenced Aug 22, 2026
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.
What changed?
Check the SQL session refresh throttle before discarding the current connection pool.
Previously, a forced refresh cleared and closed the active pool before checking whether the refresh was throttled. If throttled, no replacement pool was created and the database handle was temporarily left without a connection pool.
The current pool is now preserved when the refresh is rejected by the throttle.
Why?
This addresses the refresh-ordering failure mode described in #11691.
It does not address stale errors from an older connection pool triggering refresh of a newer pool; that requires separate generation-aware handling.
How did you test it?
Added a deterministic regression test using the existing fake clock and SQL connector. The test verifies that a throttled forced reconnect:
Validated with:
go test ./common/persistence/sql/sqlplugin/... -count=1go test -race ./common/persistence/sql/sqlplugin/ -run 'TestDatabaseHandle' -count=1go vet ./common/persistence/sql/sqlplugin/