SMTP timeout notes in smtp.ts and the changelog describe nodemailer 10.0, not 10.1
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
- 領域
- backend
調査の方向性
src/email/smtp.ts の SMTP_DNS_TIMEOUT_MS と SMTP_MAX_CONNECTIONS の上にあるコメント、src/email/smtp.test.ts の指定されたテスト、および CHANGELOG の Unreleased Fixed 項目を読みます。これらの注記を更新し、共有される10秒の接続期限、プール内のアイドル接続が4分後に閉じられること、テストで確認する内容を説明してください。タイムアウト値は変更しないでください。これらの箇所のどこにも、アドレスごとのタイムアウトや30秒のグリーティングが記述されていなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
What happens
nodemailer 10.1, which #616 brings in, changed what connectionTimeout covers. In 10.0 it bounded only the TCP connect, and it started again for each address a host name resolves to. In 10.1 it is one deadline for setting up the whole session: the DNS lookup, every address tried, the TCP connect, TLS, the server's greeting and the STARTTLS upgrade. nodemailer's pool also now closes a connection itself after 4 minutes idle (its new idleTimeout, default 240 s).
We set that limit to 10 s (SMTP_CONNECTION_TIMEOUT_MS in src/email/smtp.ts), and three places still describe 10.0:
- The comment above
SMTP_DNS_TIMEOUT_MSsays the connect limit is per address, so "with three addresses down the sign-in request's own 30 s limit runs out first", and that once a server answers its pace is left to nodemailer's defaults, "30 s for the greeting". Now a host that is down fails in 10 s however many addresses it has, and the greeting has to arrive within what's left of the same 10 s. - The test "leaves a server that has answered to nodemailer's defaults" in
src/email/smtp.test.tsstill passes, since it only checks thatgreetingTimeoutandsocketTimeoutare unset, but its name now promises more than is true. - The CHANGELOG (Unreleased, Fixed, the
SMTP_SECURE/ port 465 entry) says a host that is down fails "in about 10 seconds for each address its name resolves to (nodemailer tries them in turn)".
Nothing breaks. The tophat on #616 measured it: a server that waits 12 s before its greeting gets the email on 10.0.9, and on 10.1.4 the send fails at 10 s with ETIMEDOUT "Greeting never received". Real submission relays greet in well under a second. The cost is the notes: the next person to tune these limits would start from the wrong model.
Fix, in outline
- Rewrite the comment above
SMTP_DNS_TIMEOUT_MS/SMTP_CONNECTION_TIMEOUT_MS: one 10 s budget runs from the DNS lookup to the end of STARTTLS, across every address, so a host that is down or never greets fails in 10 s, well inside the sign-in request's 30 s (MAGIC_LINK_SEND_TIMEOUT_MSinsrc/auth/magic-link-send.ts). Keep the reason the later limits are left alone: once the message is being sent, a timeout after the relay took it means a retried reminder and a duplicate email. - Keep both values at 10 s. Failing fast is still the point, and it leaves room under the 30 s sign-in limit. Note that nodemailer now uses the smaller of
dnsTimeoutandconnectionTimeoutfor the lookup. - In the pool comment above
SMTP_MAX_CONNECTIONS, add that nodemailer closes a pooled connection after 4 minutes idle, and the next email opens a new one. LeaveidleTimeoutat nodemailer's default. - Rename the test to say what it checks, for example "leaves the pace after the greeting to nodemailer's defaults", and adjust its comment to match.
- Correct the CHANGELOG entry in place (it's still Unreleased): a mail host that is down, or that doesn't greet, now fails a send in about 10 seconds in all.
Watch for
- Comments, one test name and the changelog only. No value changes, so nothing to tophat.
- The test "gives up on a host that is down in seconds, not minutes" pins both values at 10 s or less. Leave it as it is.
- The #333 entry under Changed in the CHANGELOG ("A connection the mail server closes while idle is dropped, and the next email opens a new one") is still true. Add the 4-minute idle close there only if it reads naturally.
Order
After #616, because these notes should describe the nodemailer version on main, and #616 is what brings in 10.1.
Done when
- The comment in
src/email/smtp.tsdescribes one connection deadline covering DNS, every address, TLS, the greeting and STARTTLS, and the pool's 4-minute idle close. It no longer mentions a per-address limit or a 30 s greeting. - The test in
src/email/smtp.test.tshas a name that matches what it checks. - The CHANGELOG no longer says the 10 s applies per address.
pnpm lint && pnpm typecheck && pnpm knip && pnpm testpass.
From the tophat of #616 (nodemailer 10.0.9 → 10.1.4), checked against main at ee0f0d5. Verified by sending through SmtpTransport on both versions to a local Mailpit relay and to a stand-in server that delays its greeting, and by reading nodemailer 10.1.4's smtp-connection and smtp-pool.
Generated by Claude Code
- 主要言語
- TypeScript
- スター
- 19
- フォーク
- 4
- 平均マージ
- 21時間 3分
- マージ済み PR(30日)
- 176
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
richshaw/OpenSignup のほかの issue
-
enhancement pipeline:proposed pipeline:ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
richshaw/OpenSignup#654 ·
メンテナーはふだん 1 日以内に返信
-
The help pages never say "pause", so organizers looking for it miss Close or reopen a signup対応中かも @richshaw が 1 日前に担当しました。 オープンenhancement pipeline:building pipeline:ux
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
richshaw/OpenSignup#653 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement pipeline:proposed pipeline:ux
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
richshaw/OpenSignup#652 ·
メンテナーはふだん 1 日以内に返信
-
enhancement pipeline:proposed pipeline:ux
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
richshaw/OpenSignup#589 ·
メンテナーはふだん 1 日以内に返信
-
enhancement pipeline:proposed pipeline:ux
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
richshaw/OpenSignup#588 ·
メンテナーはふだん 1 日以内に返信
richshaw/OpenSignup の issue をすべて見る
似ている issue
-
[Bug]: Payment providers removed from config are never disabled in payment_provider対応中かも @medusa-os-bot が今日担当しました。 オープンtype: bug
難易度 2/5 半日 初心者へのやさしさ 82/100
medusajs/medusa#17544 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
software-mansion/argent#1651 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
lane:reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信