Commit aeab9f9
authored
fix(reqresp): clear composed response timeout signals (#9029)
## Summary
Open the Lodestar side of the memory-leak mitigation by clearing
composed response-timeout signals in req/resp request handling.
This is the Lodestar-local follow-up for the network-thread leak
investigation in #8969. It addresses the req/resp timeout-signal
retention path by replacing the `AbortSignal.any(...)` composition with
a clearable composed signal and explicitly clearing listeners once the
response stream is done.
This PR is intentionally scoped to the req/resp fix only.
The separate residual gossipsub topic-retention issue is being tracked
upstream in `ChainSafe/js-libp2p-gossipsub#543`, and we can pick that up
once a new libp2p release lands.
## Change
- add `createRespSignal()` helper in
`packages/reqresp/src/request/index.ts`
- compose request signal + timeout signal via an `AbortController`
- remove abort listeners explicitly via `respSignal.clear()` after the
response closes
## Validation
- `pnpm build`
- `pnpm lint` *(warning-only: pre-existing unused biome suppression in
`packages/light-client/test/unit/webEsmBundle.browser.test.ts`)*
## AI disclosure
This PR was authored with AI assistance (Lodekeeper 🌟).
---------
Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com>1 parent 1ddf8e4 commit aeab9f9
1 file changed
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
39 | 75 | | |
40 | 76 | | |
41 | 77 | | |
| |||
154 | 190 | | |
155 | 191 | | |
156 | 192 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 193 | + | |
160 | 194 | | |
161 | 195 | | |
162 | 196 | | |
| |||
199 | 233 | | |
200 | 234 | | |
201 | 235 | | |
| 236 | + | |
202 | 237 | | |
203 | 238 | | |
204 | 239 | | |
| |||
0 commit comments