Commit 52549d3
authored
feat(sync-service): cap logger handler OLP mailboxes (#4456)
## What
Cap the overload-protection (OLP) mailboxes of the three logger handlers
used by `sync-service` so that error/log bursts shed messages instead of
blocking `Logger` callers or letting processes' mailboxes grow
unbounded.
Three sites, all inside `packages/sync-service/`:
1. **Default console handler** (`config/runtime.exs`) — `sync_mode_qlen:
2000, drop_mode_qlen: 2000, flush_qlen: 5000`. Matches the stratovolt
`cloud-sync-service` precedent.
2. **`OtelMetricExporter.LogHandler`** (`config/runtime.exs`) — extends
the existing `:config` map with `drop_mode_qlen: 2000, flush_qlen:
5000`. `sync_mode_qlen` is intentionally **not** set: the handler module
forces `sync_mode_qlen == drop_mode_qlen`, so it would be a no-op. This
handler had no caps anywhere before.
3. **Sentry handler** (`lib/electric/application.ex`) — passes
`discard_threshold: 2000, sync_threshold: nil` to
`Electric.Telemetry.Sentry.add_logger_handler/2` (the function already
accepts opts; only the call site changed). Matches the stratovolt
precedent.
## Why
During the 2026-05-21 pod-replacement spikes, `logger_olp` mailboxes
peaked at ~76K/~59K. Capping these mailboxes protects the leading edge
of redeployment-shock overload.
`overload_kill_enable` is deliberately **not** set on either OLP
handler: for the console handler it would terminate the handler and lose
all subsequent logs until restart; for `OtelMetricExporter.LogHandler`
it would tear down the entire `LogHandlerSupervisor`, creating a
restart-amplification loop.1 parent fcf9749 commit 52549d3
3 files changed
Lines changed: 30 additions & 1 deletion
File tree
- .changeset
- packages/sync-service
- config
- lib/electric
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
377 | 389 | | |
378 | 390 | | |
379 | 391 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
0 commit comments