Commit e8a4e56
async_hooks: fix leak in AsyncLocalStorage exit
If exit is called and then run or enterWith are called within the
exit function, the als instace should not be added to the storageList
additional times. The correct behaviour is to remove the instance
from the storageList before executing the exit handler and then to
restore it after.
PR-URL: #35779
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>1 parent 427968d commit e8a4e56Copy full SHA for e8a4e56
File tree
Expand file treeCollapse file tree
2 files changed
+36
-7
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+36
-7
lines changedOpen diff view settings
Collapse file
+11-7Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
268 | 268 | |
269 | 269 | |
270 | 270 | |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
271 | 279 | |
272 | 280 | |
273 | 281 | |
| ||
277 | 285 | |
278 | 286 | |
279 | 287 | |
280 | | - |
281 | | - |
282 | | - |
283 | | - |
284 | | - |
| 288 | + |
285 | 289 | |
286 | 290 | |
287 | 291 | |
| ||
305 | 309 | |
306 | 310 | |
307 | 311 | |
308 | | - |
| 312 | + |
309 | 313 | |
310 | 314 | |
311 | 315 | |
312 | | - |
| 316 | + |
313 | 317 | |
314 | 318 | |
315 | 319 | |
|
Collapse file
test/parallel/test-async-local-storage-exit-does-not-leak.js
Copy file name to clipboard+25Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
0 commit comments