Skip to content

refactor: provide AppState.waitForSchemaCacheLoaded function#4709

Merged
steve-chavez merged 1 commit intoPostgREST:mainfrom
mkleczek:refactor/wait-for-schema-cache-loading
Mar 12, 2026
Merged

refactor: provide AppState.waitForSchemaCacheLoaded function#4709
steve-chavez merged 1 commit intoPostgREST:mainfrom
mkleczek:refactor/wait-for-schema-cache-loading

Conversation

@mkleczek
Copy link
Copy Markdown
Collaborator

@mkleczek mkleczek commented Mar 11, 2026

DISCLAIMER:
This commit was authored entirely by a human without the assistance of LLMs.

This commit replaces ioRef based implementation of schema cache status tracking to MVar based, so that it is possible to wait for schema cache loading.

Waiting for schema cache loading is necessary to implement zero-downtime upgrades with SO_REUSEPORT, where listening on a socket must wait for schema cache loading.

Prerequisite of #4703

Copy link
Copy Markdown
Member

@steve-chavez steve-chavez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Comment thread src/PostgREST/AppState.hs Outdated
@mkleczek mkleczek force-pushed the refactor/wait-for-schema-cache-loading branch 2 times, most recently from 44daca3 to 568d7b5 Compare March 12, 2026 10:15
This commit replaces ioRef based implementation of schema cache status tracking to MVar based, so that it is possible to wait for schema cache loading.

Waiting for schema cache loading is necessary to implement zero-downtime upgrades  with SO_REUSEPORT, where listening on a socket must wait for schema cache loading.
@mkleczek mkleczek force-pushed the refactor/wait-for-schema-cache-loading branch from 568d7b5 to 9934a41 Compare March 12, 2026 10:20
@steve-chavez steve-chavez merged commit e741c1b into PostgREST:main Mar 12, 2026
32 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