From 230be33607c510a07153b8c015f50c1883b3819d Mon Sep 17 00:00:00 2001 From: "E. Kolpakov" Date: Wed, 27 Apr 2016 16:37:54 +0300 Subject: [PATCH] Configurable timeouts for celery workers --- playbooks/roles/edxapp/defaults/main.yml | 1 + playbooks/roles/edxapp/templates/workers.conf.j2 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/edxapp/defaults/main.yml b/playbooks/roles/edxapp/defaults/main.yml index 23648bfb512..03827d9b821 100644 --- a/playbooks/roles/edxapp/defaults/main.yml +++ b/playbooks/roles/edxapp/defaults/main.yml @@ -599,6 +599,7 @@ edxapp_git_ssh: "/tmp/edxapp_git_ssh.sh" edxapp_legacy_course_data_dir: "{{ edxapp_app_dir }}/data" edxapp_workers: "{{ EDXAPP_CELERY_WORKERS }}" +EDXAPP_WORKER_DEFAULT_STOPWAITSECS: 432000 # setup for python codejail edxapp_sandbox_venv_dir: '{{ edxapp_venvs_dir }}/edxapp-sandbox' diff --git a/playbooks/roles/edxapp/templates/workers.conf.j2 b/playbooks/roles/edxapp/templates/workers.conf.j2 index 10dc8848fa4..8a86048d2b2 100644 --- a/playbooks/roles/edxapp/templates/workers.conf.j2 +++ b/playbooks/roles/edxapp/templates/workers.conf.j2 @@ -10,7 +10,7 @@ stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log command={{ edxapp_venv_dir + '/bin/newrelic-admin run-program ' if w.monitor and COMMON_ENABLE_NEWRELIC_APP else ''}}{{ edxapp_venv_bin }}/python {{ edxapp_code_dir }}/manage.py {{ w.service_variant }} --settings=aws celery worker --loglevel=info --queues=edx.{{ w.service_variant }}.core.{{ w.queue }} --hostname=edx.{{ w.service_variant }}.core.{{ w.queue }}.%%h --concurrency={{ w.concurrency }} {{ '--maxtasksperchild ' + w.max_tasks_per_child|string if w.max_tasks_per_child is defined else '' }} killasgroup=true stopasgroup=true -stopwaitsecs=432000 +stopwaitsecs={{ w.stopwaitsecs | default(EDXAPP_WORKER_DEFAULT_STOPWAITSECS) }} stopsignal=INT {% endfor %}