Commit 5d8acf9
committed
fix(relay-eager): wake a parked read by cancelling the reader, not by racing
The eager producer raced every read against one never-settled abort promise.
Each completed read leaves a reaction attached to that pending promise, so a
long stream retained one callback per chunk until abort — the exact retention
class relay.ts documents avoiding at its own drain ("Deliberately NOT a shared
Promise.race companion"), reintroduced in the relay this campaign added.
Abort now cancels the reader instead, which settles the parked read on a silent
upstream the same way relay.ts's stopDrain does, and the loop checks the signal
once per iteration. The 31 eager-relay tests — cancel-drain expiry, shutdown
while paused, synthetic tails, teardown, and rewrite framing — stay green, which
is what proves the wake-up path is unchanged.1 parent 503786a commit 5d8acf9
1 file changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | | - | |
207 | | - | |
| 208 | + | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
| |||
0 commit comments