fix: Flush pool as late as possible during schema cache reloading (#4645)

retryingSchemaCacheLoad flushes the pool upon every retry before it starts reloading the schema. This is too early as schema reloading might take some time during which new connections might be acquired. The consequence is that:
* upon successful schema cache reload we might have some connections created with the old schema cache
* we close connections upon each retry and under load we will keep closing and re-opening connections until schema cache load succeeds

This change is to make sure we flush the pool only after successful schema cache querying but before loading (so that connections acquired during loading wait for it and do not interfere with timing the loading process).
This commit is contained in:
Michal Kleczek
2026-04-14 17:09:25 -05:00
committed by GitHub
parent 4ca34c0695
commit aca58c8571
4 changed files with 14 additions and 10 deletions
+4
View File
@@ -15,6 +15,10 @@ All notable changes to this project will be documented in this file. From versio
- Add config `db-timezone-enabled` for optional querying of timezones by @taimoorzaeem in #4751
- Log when the pool is released during schema cache reload on `log-level=debug` by @mkleczek in #4668
### Fixed
- Fix unnecessary connection pool flushes during schema cache reloading by @mkleczek in #4645
### Changed
- All responses now include a `Vary` header by @develop7 in #4609