Commit 2c246a9
committed
Evict ended telemetry streams from the client actor cache
The per-component stream task exits once it sees no receivers and reports
`StreamStatus::Ended`, but the actor only removed the component from the
retry map — the now-dead `broadcast::Sender` stayed cached in
`component_streams`. Any later subscription for that component was handed
`tx.subscribe()` on that dead sender without a new tonic stream being
started, so it never received telemetry. With the telemetry trackers now
exiting cleanly instead of leaking (which used to hold receivers forever
and mask this), every drop-pool/rebuild cycle hit it: the rebuilt pool saw
its components as permanently silent.
On `Ended`, drop the cached sender so the next subscription starts a fresh
stream. If a subscriber arrived in the window between the stream task's
no-receivers check and the actor processing `Ended`, the entry still has
receivers — restart the stream for them instead of evicting it, since the
old task is already gone either way.
Fixes #42.
Signed-off-by: Sahas Subramanian <sahas.subramanian@proton.me>1 parent 649cbc9 commit 2c246a9
2 files changed
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
85 | 108 | | |
86 | 109 | | |
87 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
408 | 436 | | |
0 commit comments