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
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.
The text was updated successfully, but these errors were encountered:
There was a slight time window in between starting the socket listener
and actually setting the config in persistent_term that could rely in a
crash on incoming requests. This commit fixes this by calling the warmup
function as a child in the endpoint supervisor, after the config is started,
but before the socket listener is started.
Fixes#5981.
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
:phoenix/lib/phoenix/endpoint/supervisor.ex
Lines 13 to 16 in 222d9ab
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.
The text was updated successfully, but these errors were encountered: