Merge proposal "needs review" emails can be sent before the diff is generated

Bug #1210378 reported by William Grant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

Setting an MP to Needs Review creates an UpdatePreviewDiffJob and a MergeProposalNeedsReviewEmailJob. The Needs Review email contains the preview diff, if present, so its job needs to run after the UpdatePreviewDiffJob. Pre-celery this works fine, as the two job types are run by a single serialised runner. But in the celery world the jobs can be run simultaneously, and the email is sent before the diff is generated, so the diff is not attached.

I'm not quite sure how to fix this. Possibly the MPNREJ should be created SUSPENDED. The UPDJ can then unsuspend it when it completes. But if the UPDJ fails we still need to unsuspend the MPNREJ, possibly via a celerybeat task that just unsuspends any MPNREJ over a certain age.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.