django - docker-compose and graceful Celery shutdown -
i've been wondering , searching solutions , didn't find any.
i'm running celery in container built docker-compose. container configured this:
celery: build: . container_name: cl01 env_file: ./config/variables.env entrypoint: - /celery-entrypoint.sh volumes: - ./django:/django depends_on: - web - db - redis stop_grace_period: 1m
and entrypoint script looks this:
#!/bin/sh # wait django sleep 10 su -m dockeruser -c "celery -a myapp worker -l info"
now, if run docker-compose stop
, have warm (graceful) shutdown, giving celery provided 1 minute (stop_grace_period
) finish started tasks. docker-compose stop
seems kill celery straight away. celery should log asked shut down gracefully, don't see abrupt stop task logs.
what doing wrong or need change make celery shut down gracefully?
edit: suggested answer below providing --timeout
parameter docker-compose stop
not solve issue.
via docs
usage: stop [options] [service...] options: -t, --timeout timeout specify shutdown timeout in seconds (default: 10).
try timeout set 60 seconds @ least.
Comments
Post a Comment