Repository navigation
docs: state the SMTP retry count that mail.rs actually performs - #423
Merged
Merged
Conversation
Two documents said the verification mail is retried three times. It is retried twice: mail.rs declares MAX_ATTEMPTS = 3 and its own comments spell the difference out — "one initial attempt plus two retries, three attempts in total". The distinction is not cosmetic. routes/mod.rs works out the worst case for the registration path as three attempts x 15s plus two 2s delays; read as three retries it becomes four attempts and three delays, so any sizing or timeout question answered from the prose lands one attempt too high.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two documents state the SMTP verification-mail retry count as three retries. The code performs two retries.
docs/architecture.md:34docs/user-stories.md:18src/mail.rsis unambiguous, and it distinguishes the two words itself:The file header repeats it — "最多 2 次重试(共 3 次尝试)" — and the loop
for attempt in 1..=MAX_ATTEMPTSmakes three attempts, sleeping only whenattempt < MAX_ATTEMPTS, i.e. twice. So the prose contradicts a constant whose neighbouring comment already names the exact mistake.Why the number matters.
src/routes/mod.rsderives the worst case for the registration path from it: three attempts × 15 s per attempt + 2 × 2 s delay = 49 s of blocked worker. Reading the prose as "3 retries" gives four attempts and three delays = 66 s. Anything sized or timed from the documents is then one attempt too pessimistic — and this is the pathregister_smtp_failure_502and thesmtpblocking-I/O note inroutes/mod.rsboth reason about.Measured on the shipped artifact, not only on
main. At release tagv0.7.33both files carry the same wrong sentence andsrc/mail.rscarries the sameMAX_ATTEMPTS = 3, so the release does not already contain a fix — this is a live defect in what users download.It was wrong when it was written, not drifted.
git log -S "重试 3 次" -- docs/returns exactly one commit,6d87213(the one that introduced the sentence), andMAX_ATTEMPTShas been 3 since19869d2— it has never changed. The reword here follows the constant's own vocabulary rather than inventing a third phrasing.Both carriers are corrected together: they state one fact, so fixing one would leave the other contradicting it.
Related Issue
None — the repository's issue list is empty. This was found by checking the documents' numeric claims against the constants they describe.
Changes
Tests
cargo test— 579 passed, 0 failed.cargo fmt --check— passes.src/deploy_gate.rssays twice that it does not coverdocs/architecture.md; nothing parsesdocs/user-stories.md).Checklist
docs/).