Skip to content

fix(compose): wait for healthchecks before starting osprey-ui-api#294

Draft
haileyok wants to merge 1 commit into
mainfrom
claude/issue-96a-compose-healthchecks
Draft

fix(compose): wait for healthchecks before starting osprey-ui-api#294
haileyok wants to merge 1 commit into
mainfrom
claude/issue-96a-compose-healthchecks

Conversation

@haileyok
Copy link
Copy Markdown
Member

Description

Converts osprey-ui-api.depends_on in docker-compose.yaml from the bare list form to the long form with condition: keys, so the container waits for postgres to be service_healthy before starting.

On a clean boot the osprey-ui-api container was crashing with:

psycopg2.OperationalError: could not translate host name "postgres" to address: Name or service not known

The bare list form of depends_on only waits for the dependency container to be started, not ready. Postgres already defines a pg_isready healthcheck (line 260), so we can wait on it properly.

For the three other dependencies (osprey-worker, druid-broker, snowflake-id-worker), no healthcheck: is defined, so they stay on service_started. Adding healthchecks for those is plausible follow-up work but out of scope here.

Closes #96 (sub-item 2 of the friction log).

Changes

  • osprey-ui-api.depends_on: bare list -> long form with explicit condition: per dep
    • postgres: service_healthy (has pg_isready healthcheck)
    • osprey-worker, druid-broker, snowflake-id-worker: service_started (no healthcheck defined)

Testing

Live boot verification deferred to the operator (a live osprey stack is running on this machine and shouldn't be disturbed).

Static verification:

  • docker compose -f docker-compose.yaml config --quiet -> exit 0
  • python3 -c "import yaml; yaml.safe_load(open('docker-compose.yaml'))" -> OK
  • Rendered config shows all four entries resolve with the expected condition and required: true.

Checklist

  • Static docker compose config validates
  • No scope creep (only the osprey-ui-api.depends_on block changed)
  • Live docker compose up boot verified by operator

Convert osprey-ui-api.depends_on from the bare list form (which waits
for containers to be started but not ready) to the long form with
condition keys. Postgres has a pg_isready healthcheck, so wait on
service_healthy there; the other three deps (osprey-worker,
druid-broker, snowflake-id-worker) have no healthcheck defined, so
fall back to service_started.

Fixes the first-boot crash where osprey-ui-api raced postgres and
errored with "could not translate host name 'postgres' to address".

Refs #96.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 81a626d2-5448-4ea0-96ac-8207ccd5d8d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-96a-compose-healthchecks

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Friction Log for setting up Osprey

1 participant