Skip to content

Cache SMTP clients only after setup succeeds - #74185

Open
drewrukin wants to merge 3 commits into
apache:mainfrom
drewrukin:fix/air-20261004-11-smtp-setup
Open

drewrukin wants to merge 3 commits into
apache:mainfrom
drewrukin:fix/air-20261004-11-smtp-setup

Conversation

@drewrukin

Copy link
Copy Markdown
Contributor

Failed SMTP setup leaves a partially initialized client available for reuse. Cache synchronous and asynchronous clients only after setup and authentication succeed. Close failed clients while preserving the original exception, including failures during async connection creation.

Add regression tests for synchronous and asynchronous setup failures, cleanup and successful reconnection.


Was generative AI tooling used to co-author this PR?
  • Yes — Codex (GPT-6)

Generated-by: Codex (GPT-6) following the guidelines

@shivaam shivaam left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking issues found in source review. This complements #74416 by keeping failed setup clients out of the cache. One nonblocking test suggestion inline; tests were not rerun locally for this review.


Drafted-by: Codex (reviewed locally)

@drewrukin

Copy link
Copy Markdown
Contributor Author

Thank you for the review. The cancellation cases are now covered, the branch has been rebased, and the SMTP/provider checks pass. The remaining static failure is an unrelated HTTP 504 while downloading kind. Could you please take another look when convenient?

Cache synchronous and asynchronous SMTP clients only after setup succeeds. Close clients on connection, TLS or authentication failure without masking the original exception, and cover cleanup and reconnection.
Define async authentication mocks explicitly, matching the existing fixtures, so cleanup and reconnection regressions run with the oldest dependency set.
@eladkal
eladkal force-pushed the fix/air-20261004-11-smtp-setup branch from 686548e to 4ddb51d Compare November 19, 2026 19:50

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants