Commit c7f11f2b by Feanil Patel Committed by GitHub

Merge pull request #3693 from edx/feanil/fix_notifier_celery_process_leak

Feanil/fix notifier celery process leak
parents 8d4a11bf a9d53a89
...@@ -12,7 +12,9 @@ IFS="," ...@@ -12,7 +12,9 @@ IFS=","
-v add verbosity to edx_ansible run -v add verbosity to edx_ansible run
-h this -h this
<repo> - must be one of edx-platform, edx-workers, xqueue, cs_comments_service, credentials, xserver, configuration, read-only-certificate-code, edx-analytics-data-api, edx-ora2, insights, ecommerce, programs, course_discovery <repo> - must be one of edx-platform, edx-workers, xqueue, cs_comments_service, credentials, xserver, configuration,
read-only-certificate-code, edx-analytics-data-api, edx-ora2, insights, ecommerce, programs, course_discovery,
notifier
<version> - can be a commit or tag <version> - can be a commit or tag
EO EO
...@@ -59,6 +61,7 @@ repos_to_cmd["insights"]="$edx_ansible_cmd insights.yml -e 'INSIGHTS_VERSION=$2' ...@@ -59,6 +61,7 @@ repos_to_cmd["insights"]="$edx_ansible_cmd insights.yml -e 'INSIGHTS_VERSION=$2'
repos_to_cmd["ecommerce"]="$edx_ansible_cmd ecommerce.yml -e 'ECOMMERCE_VERSION=$2'" repos_to_cmd["ecommerce"]="$edx_ansible_cmd ecommerce.yml -e 'ECOMMERCE_VERSION=$2'"
repos_to_cmd["programs"]="$edx_ansible_cmd programs.yml -e 'PROGRAMS_VERSION=$2'" repos_to_cmd["programs"]="$edx_ansible_cmd programs.yml -e 'PROGRAMS_VERSION=$2'"
repos_to_cmd["discovery"]="$edx_ansible_cmd discovery.yml -e 'DISCOVERY_VERSION=$2'" repos_to_cmd["discovery"]="$edx_ansible_cmd discovery.yml -e 'DISCOVERY_VERSION=$2'"
repos_to_cmd["notifier"]="$edx_ansible_cmd notifier.yml -e 'NOTIFIER_VERSION=$2'"
if [[ -z $1 || -z $2 ]]; then if [[ -z $1 || -z $2 ]]; then
......
...@@ -121,7 +121,6 @@ ...@@ -121,7 +121,6 @@
mode: "0775" mode: "0775"
become_user: "{{ notifier_user }}" become_user: "{{ notifier_user }}"
with_items: with_items:
- { src: 'notifier-celery-workers-supervisor.sh.j2', dest: '{{ notifier_app_dir }}/notifier-celery-workers-supervisor.sh' }
- { src: 'notifier-scheduler-supervisor.sh.j2', dest: '{{ notifier_app_dir }}/notifier-scheduler-supervisor.sh' } - { src: 'notifier-scheduler-supervisor.sh.j2', dest: '{{ notifier_app_dir }}/notifier-scheduler-supervisor.sh' }
- name: Write supervisord config for celery workers and scheduler - name: Write supervisord config for celery workers and scheduler
......
;
; {{ ansible_managed }} ; {{ ansible_managed }}
; ;
[program:notifier-celery-workers] [program:notifier-celery-workers]
command={{ notifier_app_dir }}/notifier-celery-workers-supervisor.sh {% do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) %}
environment={% for name,value in notifier_env_vars.items() -%}
{{ name }}="{{ value }}",
{%- endfor -%}
PID="/var/tmp/notifier-scheduler.pid",LANG="en_US.UTF-8"
{%- if NOTIFIER_THEME_NAME != "" %},DJANGO_SETTINGS_MODULE="notifier.settings_local"{% endif %}
command={{ NOTIFIER_VENV_DIR }}/bin/python manage.py celery worker -l {{ NOTIFIER_LOG_LEVEL }}
process_name=%(program_name)s process_name=%(program_name)s
numprocs=1 numprocs=1
......
#!/bin/bash
source {{ notifier_app_dir }}/notifier_env
cd {{ NOTIFIER_CODE_DIR }}
export PID='/var/tmp/notifier-scheduler.pid'
export LANG=en_US.UTF-8
{{ NOTIFIER_VENV_DIR }}/bin/python manage.py celery worker -l {{ NOTIFIER_LOG_LEVEL }}
# {{ ansible_managed }} # {{ ansible_managed }}
# Note this is used directly by the scheduler but not
# by the workers. Worker environment is set in supervisor
# config.
{% do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) %} {% do notifier_env_vars.update(NOTIFIER_ENV_EXTRA) %}
{% for name,value in notifier_env_vars.items() %} {% for name,value in notifier_env_vars.items() %}
{% if value %} {% if value %}
export {{ name }}="{{ value }}" export {{ name }}="{{ value }}"
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if NOTIFIER_THEME_NAME != "" %} {% if NOTIFIER_THEME_NAME != "" %}
export DJANGO_SETTINGS_MODULE=notifier.settings_local export DJANGO_SETTINGS_MODULE=notifier.settings_local
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment