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

Configurable SMTP Timeout (GSI-986) #20

Merged
merged 6 commits into from
Sep 6, 2024

Conversation

TheByronHimes
Copy link
Member

@TheByronHimes TheByronHimes commented Sep 6, 2024

Adds an optional smtp_timeout config option. By default it will maintain the prior infini-hang behaviour time out after 60 seconds. Added an error class to the SMTPClient to catch any instance of OSError raised by a rejected connection or timeout.

Added in some debug statements in the SMTP module to aid in future bug hunting.

Bumped the version from 2.0.0 to 2.1.0.

mephenor
mephenor previously approved these changes Sep 6, 2024
Copy link
Member

@mephenor mephenor 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, just one suggestion

src/ns/adapters/outbound/smtp_client.py Outdated Show resolved Hide resolved
Copy link
Member

@dontseyit dontseyit left a comment

Choose a reason for hiding this comment

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

Why the default is None? I would expect, as a default behavior, an error message eventually if there is a problem in connection rather than infinite waiting. Then adjusting the value accordingly if necessary. So I would say 60 seconds.

@coveralls
Copy link

coveralls commented Sep 6, 2024

Pull Request Test Coverage Report for Build 10737100864

Details

  • 20 of 21 (95.24%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.9%) to 85.874%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ns/adapters/outbound/smtp_client.py 14 15 93.33%
Totals Coverage Status
Change from base Build 10594708067: 0.9%
Covered Lines: 231
Relevant Lines: 269

💛 - Coveralls

Copy link
Member

@dontseyit dontseyit 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 now, thanks.

@TheByronHimes TheByronHimes merged commit 7d4ab9b into main Sep 6, 2024
8 checks passed
@TheByronHimes TheByronHimes deleted the feature/smtp_timeout_GSI-986 branch September 6, 2024 12:19
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