-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
featuregood first issueGood for newcomersGood for newcomersinfraFoundation of Skyflo.aiFoundation of Skyflo.ai
Description
The engine entrypoint script (deployment/engine/entrypoint.sh) uses a hardcoded sleep 30 to wait for the database before starting. This is unreliable — the database may not be ready after 30 seconds, or it may be ready much sooner, wasting startup time.
Scope
- Infra (
deployment/engine/entrypoint.sh):- Replace
sleep 30with a loop that checks database connectivity before proceeding. - Use
pg_isready(available in the container) or a lightweight Python check against theDATABASE_URLenvironment variable. - Add a configurable timeout (e.g.,
DB_WAIT_TIMEOUT, default 60 seconds) with a clear failure message if the database isn't reachable in time. - Add a similar readiness check for Redis using
redis-cli pingor equivalent if the Redis client is available.
- Replace
Acceptance criteria
- Engine waits for the database to be reachable before starting, rather than sleeping for a fixed duration.
- If the database is not reachable within the timeout, the script exits with a non-zero code and a clear error message.
- The timeout is configurable via an environment variable (
DB_WAIT_TIMEOUT). - Startup is faster when the database is already available (no unnecessary wait).
- No regressions to normal engine startup behavior.
How to test manually
- Run the database and engine containers locally (see
deployment/local.docker-compose.yaml). - Start the engine with the database already running — verify it starts without waiting the full timeout.
- Start the engine before the database — verify it waits and starts successfully once the database comes up.
- Start the engine with the database down — verify it exits with a clear error after the timeout.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featuregood first issueGood for newcomersGood for newcomersinfraFoundation of Skyflo.aiFoundation of Skyflo.ai