Skip to content

Fix SMTP notification timeouts - #5591

Open
justadityaraj wants to merge 2 commits into
kopia:masterfrom
justadityaraj:fix-5563-smtp-notification-timeout
Open

Fix SMTP notification timeouts#5591
justadityaraj wants to merge 2 commits into
kopia:masterfrom
justadityaraj:fix-5563-smtp-notification-timeout

Conversation

@justadityaraj

@justadityaraj justadityaraj commented Aug 29, 2026

Copy link
Copy Markdown

Problem

An unreachable SMTP server could leave smtp.SendMail blocked forever. Repository-server clients then waited for the synchronous notification RPC even after their snapshot had completed.

Fix

Replace the context-free SMTP helper with the equivalent client sequence over a context-aware dialer, including the existing STARTTLS and AUTH behavior. A 10-second deadline now bounds the connection and every SMTP protocol operation; an earlier caller deadline still wins. No asynchronous delivery or new configuration was added.

Fixes #5563.

User impact

A broken or blackholed SMTP notification endpoint now fails the notification after a bounded interval instead of wedging snapshot completion indefinitely.

Verification

  • Added a deterministic local-listener regression: it accepts TCP but never sends the SMTP greeting. The test fails on clean master at its one-second guard and passes with this change, returning context.DeadlineExceeded.
  • go test ./notification/... -count=1
  • go vet ./notification/...
  • git diff --check

@justadityaraj
justadityaraj requested a review from a team August 29, 2026 00:09
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.

'kopia snapshot create' blocks indefinitely (no timeout) when a repository notification profile's SMTP server is unreachable

1 participant