Repository navigation
Commit f090d13
committed
stream: detach sync share consumer before throwing
The `strict` backpressure branch of `SyncShareImpl` threw
`ERR_OUT_OF_RANGE` while leaving the consumer attached, so its cursor
stayed in the consumer set and kept pinning the buffer. Consumers that
were still reading correctly then hit the same error a few entries
later, because the buffer could no longer be trimmed past the stuck
cursor.
Build the error first, then detach and delete the consumer before
throwing, so the reported byte count still describes the condition that
triggered the failure. Every other terminal path of the same iterator
already detaches, and the async `ShareImpl` was fixed the same way.
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>1 parent c90c3dd commit f090d13
2 files changed
Lines changed: 45 additions & 2 deletions
File tree
- lib/internal/streams/iter
- test/parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
590 | | - | |
| 589 | + | |
| 590 | + | |
591 | 591 | | |
592 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
593 | 597 | | |
594 | 598 | | |
595 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
214 | 252 | | |
215 | 253 | | |
216 | 254 | | |
| |||
229 | 267 | | |
230 | 268 | | |
231 | 269 | | |
| 270 | + | |
232 | 271 | | |
233 | 272 | | |
0 commit comments