Commit af19055
authored
notification: Fix memory leak of pending substreams (#296)
This PR fixes a subtle memory leak that can happen in the following
edge-case situation:
- connection is established and substream outbound is initiated with
remote peer
- the substream ID is tracked until the substream either completes
successfully or fails
- the connection is closed soon after, leading to no substream events
ever being generated
For this edge-cases, we need to remove the tracking of the substream ID
when the connection is reported as closed.
This has been detected after running a node for more than 2 days with
the following generic metrics PR:
- #294
Closes: #295
cc @paritytech/networking
---------
Signed-off-by: Alexandru Vasile <[email protected]>1 parent 7612ec9 commit af19055
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
| |||
0 commit comments