Commit da27ca4
perf(server): bound the provider runtime-event bus
ProviderService exposes a unified runtime-event stream via a PubSub that
internal consumers (ProviderRuntimeIngestion, CheckpointReactor) each
subscribe to. The bus was `PubSub.unbounded`, so if any consumer lagged
during an event burst its per-subscriber backlog grew without bound,
risking unbounded memory growth and eventual OOM under load.
Switch to `PubSub.bounded` with a generous capacity. Because runtime
events feed event-sourced orchestration ingestion and must never be
dropped, this uses the suspending (backpressure) strategy: a slow
consumer now applies backpressure up to the adapter stdio reader instead
of silently accumulating memory. This keeps behavior predictable under
load while preserving at-least-once delivery semantics.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a0b5d39 commit da27ca4
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
169 | 180 | | |
170 | 181 | | |
171 | 182 | | |
| |||
199 | 210 | | |
200 | 211 | | |
201 | 212 | | |
202 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
203 | 216 | | |
204 | 217 | | |
205 | 218 | | |
| |||
0 commit comments