Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retryOnFailure option #112

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Add retryOnFailure option #112

merged 1 commit into from
Jan 31, 2024

Conversation

thgeorgiou
Copy link
Contributor

Hello!

I made a small change to allow the administrator to control if whether they want to try sending a mail if there is a failure.

In my case, sometimes my users either miss-typed their emails, or they copied the job template that had an example/invalid address. This caused files to remain in /var/spool/slurm-mail forever and the program would retry sending every minute, eventually getting my cluster banned from the mail server. Setting retryOnFailure to 0 always deletes the mail files after an attempted send.

I am catching all smtplib exceptions (SMTPHeloError, SMTPRecipientsRefused, SMTPSenderRefused, SMTPNotSupportedError) but perhaps SMTPHeloError shouldn't be caught, since it most probably represents a connection error rather than an invalid recipient.

Thank you for your work on this very useful tool!

@neilmunday neilmunday self-assigned this Jan 31, 2024
@neilmunday neilmunday added the enhancement New feature or request label Jan 31, 2024
@neilmunday neilmunday added this to the 4.11 milestone Jan 31, 2024
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/slurmmail
  cli.py 740-751
Project Total  

This report was generated by python-coverage-comment-action

@neilmunday neilmunday changed the base branch from main to 4.11 January 31, 2024 21:08
@neilmunday
Copy link
Owner

Thanks for this feature @thgeorgiou - very useful.

I will add this to the 4.11 release together with how to use the option in the README.

Glad you like Slurm-Mail :-)

@neilmunday neilmunday merged commit 6042338 into neilmunday:4.11 Jan 31, 2024
46 checks passed
@neilmunday
Copy link
Owner

Version 4.11 released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants