Skip to content

WPB-27255: move email sending to background-worker - #5448

Open
blackheaven wants to merge 3 commits into
developfrom
gdifolco/WPB-27255-email-background-job
Open

WPB-27255: move email sending to background-worker#5448
blackheaven wants to merge 3 commits into
developfrom
gdifolco/WPB-27255-email-background-job

Conversation

@blackheaven

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-27255

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@blackheaven
blackheaven requested review from a team as code owners August 14, 2026 15:58
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Aug 14, 2026
@blackheaven
blackheaven force-pushed the gdifolco/WPB-27255-email-background-job branch 2 times, most recently from 17dab2a to f603ac2 Compare August 14, 2026 17:41
@blackheaven
blackheaven force-pushed the gdifolco/WPB-27255-email-background-job branch from f603ac2 to 9737671 Compare August 25, 2026 14:34
Rework of the email background-worker move: brig now inserts send-email
jobs into the new `emails` Arbiter queue (PostgreSQL, default Arbiter
schema) instead of publishing BackgroundJobSendEmail messages to the
RabbitMQ `background-jobs` queue.

- Wire.API.Jobs: new `emails` queue with EmailsJobPayload/SendEmailJobPayload
  (request id + SerializableMail), added to JobRegistry; the RabbitMQ
  BackgroundJobPayload loses its send-email variant and the SendEmailJob
  wrapper type is dropped.
- Wire.EmailSending.Queueing: the EmailSending interpreter now runs
  ArbiterCore.insertJob against the shared hasql pool (self-contained,
  Embed IO only; maxAttempts = 3).
- brig: wires the Arbiter-backed interpreter and runs the Arbiter job
  migrations at startup, mirroring galley.
- background-worker: new emails worker pool (Wire.EmailJobsWorker) sends
  the mail via the configured SES/SMTP transport; malformed payloads are
  rejected with a warning, send failures rethrow as retryable so Arbiter
  retry/backoff and the DLQ apply. The RabbitMQ runner's email handling
  and its exception wrapper are reverted.
- docs/changelog updated for the Arbiter semantics, including rollout
  ordering and the at-rest sensitivity of the emails/DLQ tables.
@blackheaven
blackheaven force-pushed the gdifolco/WPB-27255-email-background-job branch from a62eb6f to 4011dbf Compare August 25, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants