You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Flush pool as late as possible during schema cache reloading
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).
-- IMPORTANT: While the pending schema cache state starts from running the above querySchemaCache, only at this stage we block API requests due to the usage of an
416
414
-- IORef on putSchemaCache. This is why SCacheStatus is put at SCPending here to signal the Admin server (using isPending) that we're on a recovery state.
417
415
putSCacheStatus appState SCPending
418
-
putSchemaCache appState $Just sCache
419
416
observer $SchemaCacheQueriedObs resultTime
417
+
putSchemaCache appState $Just sCache
418
+
-- Flush the pool after loading the schema cache to reset any stale session cache entries
419
+
-- We do it after successfully querying the schema cache
0 commit comments