6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 06:07:56 +00:00

Fix unsent activation emails and other asynchronous tasks

Half of the tasks from edx.lms.core.default celery queue were being
processed by the CMS worker. Unfortunately, this CMS worker crashes on
some of those tasks. For instance, activation emails complain of a
missing "django_markup" template tag library because "xss_utils" is not
part of the installed app in the CMS.

The problem is that we need this edx.lms.core.default queue to be part
of the CELERY_QUEUES in the cms in order to send tasks from the CMS to
the LMS. The trick to resolve this situation is to ask the CMS celery
worker to not process the tasks from this queue.

To debug this issue, run in the LMS:

    from student.tasks import send_activation_email
    send_activation_email("{}")

Then watch the logs of the lms and cms workers. If the CMS workers picks
up this task (50% of the time prior to this change) then we have an
issue.

See:
https://discuss.overhang.io/t/reset-password-email-sent-but-activation-email-dont/690
This commit is contained in:
Régis Behmo 2020-06-22 12:11:15 +02:00
parent 77150c0424
commit 40a76330f6
2 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,10 @@
Note: Breaking changes between versions are indicated by "💥". Note: Breaking changes between versions are indicated by "💥".
## Unreleased
- [Bugfix] Fix unsent activation emails and other asynchronous tasks
## v10.0.5 (2020-06-21) ## v10.0.5 (2020-06-21)
- [Security] Apply edx-platform upstream xss security fixes ([pull request](https://github.com/edx/edx-platform/pull/24258)) - [Security] Apply edx-platform upstream xss security fixes ([pull request](https://github.com/edx/edx-platform/pull/24258))

View File

@ -151,7 +151,7 @@ services:
SERVICE_VARIANT: cms SERVICE_VARIANT: cms
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production} SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
C_FORCE_ROOT: "1" # run celery tasks as root #nofear C_FORCE_ROOT: "1" # run celery tasks as root #nofear
command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 --exclude-queues=edx.lms.core.default
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/ - ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/