Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Admin server /ready endpoint is incorrect on slow schema cache loads #3330

Closed
steve-chavez opened this issue Mar 15, 2024 · 0 comments · Fixed by #3334
Closed

Admin server /ready endpoint is incorrect on slow schema cache loads #3330

steve-chavez opened this issue Mar 15, 2024 · 0 comments · Fixed by #3334

Comments

@steve-chavez
Copy link
Member

steve-chavez commented Mar 15, 2024

Problem

The schema cache doesn't finish loading:

# nix-shell
$ PGRST_ADMIN_SERVER_PORT=3001  PGRST_DB_SCHEMAS="apflora" PGRST_DB_POOL=3 postgrest-with-postgresql-16 -f test/io/big_schema.sql postgrest-run

...
15/Mar/2024:09:47:13 -0500: Listening for notifications on the pgrst channel
15/Mar/2024:09:47:13 -0500: Config reloaded
15/Mar/2024:09:47:13 -0500: Schema cache queried in 27.1 milliseconds

# still no "Schema cache loaded"

And yet the ready endpoint replies successfully:

$ curl localhost:3001/ready -i

HTTP/1.1 200 OK

This is due to

isSchemaCacheLoaded <- isJust <$> AppState.getSchemaCache appState

That checks for isJust, which IS the state of the schema cache while loading but it's not yet filled (a traceShowId confirms this).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant