hypercerts-org / hypercerts-org/ePDS

Consider explicit SMTP timeouts on the OTP transport (deferred from #183)

Open
#205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DevOps / infra Product: ePDS
Dominant language
TypeScript
Stars
8
Forks
4
Avg merge
5d 11h
Merged PRs (30d)
3

Description

Background

hypercerts-org/ePDS#183 proposed optionally setting explicit SMTP timeouts on the nodemailer transport so a hung handoff surfaces as an error on a known schedule, rather than inheriting nodemailer's defaults. PR hypercerts-org/ePDS#203 delivered the diagnostic-logging half of hypercerts-org/ePDS#183 (elapsedMs / messageId / smtpResponse) but deliberately dropped the timeout change, because it alters send behaviour and the values need justification from real data, not a guess.

Why deferred

Lowering connectionTimeout or greetingTimeout below the current defaults means a slow-but-successful handshake that succeeds today could start failing — which would make late/undelivered OTPs worse, the opposite of hypercerts-org/ePDS#183's goal. We have no measurement of Resend's real handshake latency, so any chosen value is a guess.

Verified nodemailer defaults

From nodemailer@6.10.1 (lib/smtp-connection/index.js), the constants actually used:

  • connectionTimeout120000 ms (2 min) — wait for TCP connection to establish
  • greetingTimeout30000 ms (30 s) — wait for SMTP greeting after connect (note: the docstring in that file says 10000, but the code uses the GREETING_TIMEOUT = 30 * 1000 constant)
  • socketTimeout600000 ms (10 min) — inactivity before disconnect (there is a default; it is not unbounded)

What to decide

  • Whether explicit timeouts are worth the behaviour-change risk at all, given the diagnostic logging from hypercerts-org/ePDS#203 may be sufficient on its own.
  • If yes: pick each value from the elapsedMs distribution once hypercerts-org/ePDS#203 is deployed and has produced real Resend handshake/handoff timings. Choose thresholds comfortably above the observed p99 so we only fail genuine hangs, well inside the 10-minute OTP lifetime.
  • Whether the values should be env-configurable rather than hard-coded.

Dependencies

Blocked on hypercerts-org/ePDS#203 being deployed long enough to collect an elapsedMs distribution.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Wait for hypercerts-org/ePDS#203 to be deployed long enough to collect the elapsedMs distribution for Resend handshakes and handoffs. Review the nodemailer transport and observed p99 timings, then decide whether explicit timeouts are justified, whether they should be environment-configurable, and what completion means for the OTP lifetime.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.