Skip to content

v14: fix: Flush pool as late as possible during schema cache reloading#4820

Merged
taimoorzaeem merged 1 commit intoPostgREST:v14from
taimoorzaeem:v14
Apr 16, 2026
Merged

v14: fix: Flush pool as late as possible during schema cache reloading#4820
taimoorzaeem merged 1 commit intoPostgREST:v14from
taimoorzaeem:v14

Conversation

@taimoorzaeem
Copy link
Copy Markdown
Member

Backport for #4645.

…stgREST#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).
@taimoorzaeem taimoorzaeem merged commit abd76ca into PostgREST:v14 Apr 16, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants