Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG] `depends_on` health/completion waits always sleep 500ms before the first check

Open
#14,384 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@htoyoda18 is already working on this.

Since Oct 24, 2026.

  • #14385 by @htoyoda18 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
docker, go
Domain
cli

Research direction

The cause is already pinpointed: the wait loop in pkg/compose/service_containers.go ticks on a 500ms time.Ticker before its first dependency check, so it sleeps even when the dependency is already healthy. Read waitDependency and restructure the loop to check first, then wait for the next tick; 'done' is a no-op docker compose up -d --wait timing near ~0.07s. Note: open pull request #14385 already targets this, so the work is underway.

Written by the indexing model from the issue text.

Description

kind/bug status/0-triage
Description

When a service waits on a dependency with condition: service_healthy or service_completed_successfully, Compose always waits 500ms before it checks the dependency for the first time, even when the dependency is already healthy. up --wait pays this delay again in its final check. As a result, a no-op docker compose up -d takes ~0.6s instead of ~0.07s, and up -d --wait takes ~1.1s instead of ~0.07s.

The cause is waitDependency in pkg/compose/service_containers.go: the loop waits on a 500ms time.Ticker before the first check. The loop has had this shape since 2021.

Steps To Reproduce
  1. Create compose.yaml

    services:
      db:
        image: alpine:3.20
        command: sleep infinity
        init: true
        healthcheck:
          test: ["CMD", "true"]
          interval: 1s
          start_interval: 1s
          start_period: 5s
      app:
        image: alpine:3.20
        command: sleep infinity
        init: true
        depends_on:
          db:
            condition: service_healthy
    
  2. Run docker compose up -d --wait once, so that everything is up and healthy.

  3. Time a no-op run: time docker compose up -d and time docker compose up -d --wait .

Compose Version
Docker Compose version v5.6.1
Docker Environment

Anything else?

No response

Dominant language
Go
Stars
38.5k
Forks
5.9k
Avg merge
1d 17h
Merged PRs (30d)
63

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/compose

All issues in docker/compose

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.