Skip to content

fix: make bulk_email send email task handles a retryable exception#29080

Merged
hurtstotouchfire merged 3 commits intoopenedx:masterfrom
ghassanmas:ghassanmas/fix-bulk-email
Mar 30, 2022
Merged

fix: make bulk_email send email task handles a retryable exception#29080
hurtstotouchfire merged 3 commits intoopenedx:masterfrom
ghassanmas:ghassanmas/fix-bulk-email

Conversation

@ghassanmas
Copy link
Member

Description

According to bulk_email and SMTP doc, when an error code is between
(400-499) it can be retried after sometime, this commit adds a new
type of exception called SMTPSenderRefused, so it can be retried
if it's code fails under above constraint.

Useful information to include:

  • Which edX user roles will this change impact? Common user roles are "Learner", "Course Author",
    "Developer", and "Operator".
  • Include screenshots for changes to the UI (ideally, both "before" and "after" screenshots, if applicable).
  • Provide links to the description of corresponding configuration changes. Remember to correctly annotate these
    changes.

Supporting information

The issue have been reported at the forums

Testing instructions

Please provide detailed step-by-step instructions for testing this change.

Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Oct 21, 2021
@openedx-webhooks
Copy link

Thanks for the pull request, @ghassanmas! I've created OSPR-6157 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@ghassanmas ghassanmas force-pushed the ghassanmas/fix-bulk-email branch 2 times, most recently from 4afe3ca to 9e1f811 Compare October 21, 2021 11:18
@ghassanmas
Copy link
Member Author

This PR is ready to be reviwed.

@natabene
Copy link
Contributor

@ghassanmas Thank you for your contribution. Please let me know once this is ready for our review.

@ghassanmas ghassanmas force-pushed the ghassanmas/fix-bulk-email branch from 9e1f811 to 52a6367 Compare October 22, 2021 18:02
@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed needs triage labels Oct 22, 2021
@ghassanmas ghassanmas force-pushed the ghassanmas/fix-bulk-email branch from 52a6367 to 91e7a0e Compare October 25, 2021 21:18
@edx-status-bot
Copy link

Your PR has finished running tests. There were no failures.

@ghassanmas
Copy link
Member Author

@natabene It's ready now that all tests have passed

@ghassanmas ghassanmas force-pushed the ghassanmas/fix-bulk-email branch from 91e7a0e to 8182dc5 Compare February 21, 2022 15:49
@openedx-webhooks openedx-webhooks removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Feb 21, 2022
@ghassanmas ghassanmas force-pushed the ghassanmas/fix-bulk-email branch from 8182dc5 to d7156e0 Compare March 15, 2022 19:51
According to bulk_email and SMTP doc, when an error code is between
(400-499) it can be retried after sometime, this commit adds a new
type of exception called SMTPSenderRefused, so it can be retried
**if** it's code fails under above constraint.
@ghassanmas ghassanmas force-pushed the ghassanmas/fix-bulk-email branch from a8f76dd to 0d56d98 Compare March 16, 2022 09:56
@ghassanmas
Copy link
Member Author

@natabene any chance I might a look for this soon?
So far I have fixed two merge conflicts, and the issue has been reported again in the fourms

@natabene
Copy link
Contributor

@ghassanmas Let me see what I can do.

@hurtstotouchfire hurtstotouchfire self-requested a review March 18, 2022 20:24
@hurtstotouchfire
Copy link

Thanks @ghassanmas we will take a look at this. Sorry for the delay, it has been a pretty eventful couple quarters for us.

Copy link
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

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

Hey @ghassanmas, thanks for your contribution!

I would love to see a test for the new logic added before accepting this change.

The bulk email tasks tests can be found here: /lms/djangoapps/bulk_email/tests/test_tasks.py. The relevant test class/suite would be TestBulkEmailInstructorTask.

@ghassanmas ghassanmas force-pushed the ghassanmas/fix-bulk-email branch from 39c7cfc to 4177b56 Compare March 21, 2022 21:43
@ghassanmas ghassanmas requested a review from justinhynes March 21, 2022 22:02
Copy link
Contributor

@justinhynes justinhynes left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for adding the test (and for your patience!).

@ghassanmas
Copy link
Member Author

It's alright no worries. It was just when a conflict occurs at that point I would have already forgotten what I actually did! Anyway thanks for your review

@natabene
Copy link
Contributor

@ghassanmas We are looking into this and will get back to you soon

Copy link

@hurtstotouchfire hurtstotouchfire left a comment

Choose a reason for hiding this comment

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

Tentatively hope to merge this in the morning.

@hurtstotouchfire hurtstotouchfire merged commit e1d9746 into openedx:master Mar 30, 2022
@openedx-webhooks
Copy link

@ghassanmas 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Comments