Skip to content

Conversation

@brianhw
Copy link
Contributor

@brianhw brianhw commented Oct 15, 2013

Addresses a problem where bulk email subtasks are duplicated at the point that a group of subtasks is queued. Those with a requested subtask_id are created correctly, and duplicate subtasks with different ids are also created with otherwise identical arguments. This fix prevents the duplicate subtasks from actually running (and sending duplicate emails).

@brianhw
Copy link
Contributor Author

brianhw commented Oct 15, 2013

@sarina @rocha Can you review?

@sarina
Copy link
Contributor

sarina commented Oct 15, 2013

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment of why could the check fail, so a developer can figure out what to do or check if that is the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added below.

@rocha
Copy link
Contributor

rocha commented Oct 15, 2013

I had one minor comment. Once it is addressed it is good to merge 👍

@brianhw
Copy link
Contributor Author

brianhw commented Oct 15, 2013

I found in a log that the same task (i.e. submit_bulk_email) had been submitted twice by celery, due to some loss of connection or something. I'll look closer at the traceback later, but in the meantime I can at least check for the condition, and avoid the duplication. If I don't catch it at the parent task level, I should then be able to catch it at the subtask level. @sarina @rocha another look, please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% clear why we know it's the exact same task that's called and not another, new task that is spawned. I feel I'm missing some puzzle piece...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, it probably requires further investigation. However, if this has to be release soon I am ok with leaving it as it is provided we come back to figure out the problem later. Seems like something worth fixing going down the road.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task is defined by the InstructorTask object. It contains the task_type, the task_id, and the input values. If that InstructorTask object arrives at this point in the code, and we find that it already contains subtasks, then we know we don't need to define subtasks for it. (I check the output because I need it to exist before returning successfully.) And there's really no other place where the subtasks would come from, and even if they did (because something was horribly wrong), it wouldn't make sense to write over them anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that makes sense. thanks.

@rocha
Copy link
Contributor

rocha commented Oct 15, 2013

👍 but please do look later at the pending issues

@sarina
Copy link
Contributor

sarina commented Oct 16, 2013

👍

brianhw added a commit that referenced this pull request Oct 16, 2013
Check that email subtasks are known to the InstructorTask before executing.
@brianhw brianhw merged commit 5918ee5 into master Oct 16, 2013
@brianhw brianhw deleted the brian/fix-dupe-emails branch October 16, 2013 19:18
john2x pushed a commit to open-craft/openedx-platform that referenced this pull request Jan 31, 2019
john2x pushed a commit to open-craft/openedx-platform that referenced this pull request Jan 31, 2019
* Revert "version bump for scorm xblock (openedx#1354)"

This reverts commit d465dc3.

* Revert "Bump completion to v0.1.15 (openedx#1351)"

This reverts commit 58932f3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants