Skip to content

Bug: RQ worker healthcheck uses celery and can never pass #31

Description

@Alimedhat000

Summary

docker/Dockerfile.worker:86 declares a healthcheck that can never pass:

HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD celery -A app.celery inspect ping --timeout 5 -d celery@$HOSTNAME

This project uses RQ (rq worker ml), not Celery. There is no app.celery module, and celery is not installed in the worker image, so every health check fails.

Impact

  • Worker container is always reported unhealthy.
  • Any tooling that gates on the worker healthcheck (orchestrator restarts, monitoring) misbehaves.

Suggested fix

Replace with an RQ-aware check. Options:

  • redis-cli -h redis ping (needs redis-tools in the image), or
  • a tiny Python check that queries Redis for the RQ queue, e.g. python -c "import redis; r=redis.from_url('redis://redis:6379/0'); r.ping()", or
  • check a live worker is registered (r.lrange('rq:workers', 0, -1) non-empty).

Verification

  • docker compose build worker then docker compose up worker and run docker inspect on the container; the healthcheck must become healthy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions