Make "send_first_edit_email" retry on missing Revision


Code Cleanup
2 years ago
2 months ago


(Reporter: jwhitlock, Unassigned)


(Blocks: 1 bug)


(Whiteboard: [specification][type:feature])



2 years ago
What problem would this feature solve?
The task is called when a user creates their first edit.  However, the transaction that creates the revision may still be open when the task is scheduled.

Who has this problem?
Staff contributors to MDN

How do you know that the users identified above have this problem?
The transaction_task decorator from django_celery_transactions is being used to delay dispatching the task until the transaction is complete.  However, django_celery_transactions is deprecated and may not work with future versions of Django

How are the users identified above solving this problem now?
The decorator works with Django 1.8, the current version used in production

Do you have any suggestions for solving the problem? Please explain in detail.
If the revision is not available when the task is called, retry after a delay to give the transaction a chance to complete.

Is there anything else we should know?
This strategy is used in the tidy_revision_content task in the same file.


2 years ago
Blocks: 1268254

Comment 1

2 months ago
Celery 4.x recommends using Django 1.9's transaction.on_commit:

This may avoid the issue with running the task before the user is created.
You need to log in before you can comment on or make changes to this bug.