The call to warmup/1 (which sets the persistent term) happens after the Endpoint is started, so there's a small window where the HTTP server is accepting connections, but the underlying data has not been set up.
Expected behavior
All the underlying data is available when the server is accepting connections.
Environment
Actual behavior
It appears that there's a race condition when starting the endpoint:
I think this is the relevant code in
Phoenix.Endpoint.Supervisor
: https://github.com/phoenixframework/phoenix/blob/222d9aba8595f81148d454d60d2072d11a969a09/lib/phoenix/endpoint/supervisor.ex#L13-L16The call to
warmup/1
(which sets the persistent term) happens after the Endpoint is started, so there's a small window where the HTTP server is accepting connections, but the underlying data has not been set up.Expected behavior
All the underlying data is available when the server is accepting connections.