Commit 8345a82
async_hooks: add missing async_hooks destroys in AsyncReset
This adds missing async_hooks destroy calls for sockets (in
_http_agent.js) and HTTP parsers. We need to emit a destroy in
AsyncWrap#AsyncReset before assigning a new async_id when the instance
has already been in use and is being recycled, because in that case, we
have already emitted an init for the "old" async_id.
This also removes a duplicated init call for HTTP parser: Each time a
new parser was created, AsyncReset was being called via the C++ Parser
class constructor (super constructor AsyncWrap) and also via
Parser::Reinitialize.
Backport-PR-URL: #23404
PR-URL: #23272
Fixes: #19859
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 523db5f commit 8345a82Copy full SHA for 8345a82
File tree
Expand file treeCollapse file tree
16 files changed
+207
-40
lines changedOpen diff view settings
Filter options
- benchmark
- http
- misc
- lib
- internal
- src
- test
- async-hooks
- parallel
- sequential
Expand file treeCollapse file tree
16 files changed
+207
-40
lines changedOpen diff view settings
Collapse file
benchmark/http/bench-parser.js
Copy file name to clipboardExpand all lines: benchmark/http/bench-parser.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | | - |
| 34 | + |
35 | 35 | |
36 | 36 | |
37 | 37 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
9 | 9 | |
10 | 10 | |
11 | 11 | |
12 | | - |
| 12 | + |
13 | 13 | |
14 | 14 | |
15 | 15 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
167 | 167 | |
168 | 168 | |
169 | 169 | |
170 | | - |
| 170 | + |
171 | 171 | |
172 | 172 | |
173 | 173 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
48 | 48 | |
49 | 49 | |
50 | 50 | |
| 51 | + |
51 | 52 | |
52 | 53 | |
53 | 54 | |
| ||
625 | 626 | |
626 | 627 | |
627 | 628 | |
628 | | - |
| 629 | + |
629 | 630 | |
630 | 631 | |
631 | 632 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
| 26 | + |
27 | 27 | |
28 | 28 | |
29 | 29 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
42 | 42 | |
43 | 43 | |
44 | 44 | |
| 45 | + |
45 | 46 | |
46 | 47 | |
47 | 48 | |
| ||
339 | 340 | |
340 | 341 | |
341 | 342 | |
342 | | - |
| 343 | + |
343 | 344 | |
344 | 345 | |
345 | 346 | |
|
Collapse file
+17-4Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
| 3 | + |
| 4 | + |
3 | 5 | |
4 | 6 | |
5 | 7 | |
| ||
9 | 11 | |
10 | 12 | |
11 | 13 | |
12 | | - |
13 | | - |
14 | | - |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
15 | 23 | |
16 | 24 | |
17 | 25 | |
| ||
23 | 31 | |
24 | 32 | |
25 | 33 | |
26 | | - |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
Collapse file
+9Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
562 | 562 | |
563 | 563 | |
564 | 564 | |
| 565 | + |
565 | 566 | |
566 | 567 | |
567 | 568 | |
| ||
605 | 606 | |
606 | 607 | |
607 | 608 | |
| 609 | + |
| 610 | + |
| 611 | + |
| 612 | + |
| 613 | + |
| 614 | + |
| 615 | + |
| 616 | + |
608 | 617 | |
609 | 618 | |
610 | 619 | |
|
Collapse file
+8-2Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
465 | 465 | |
466 | 466 | |
467 | 467 | |
| 468 | + |
| 469 | + |
468 | 470 | |
469 | 471 | |
470 | 472 | |
| ||
473 | 475 | |
474 | 476 | |
475 | 477 | |
476 | | - |
477 | | - |
| 478 | + |
| 479 | + |
| 480 | + |
| 481 | + |
| 482 | + |
| 483 | + |
478 | 484 | |
479 | 485 | |
480 | 486 | |
|
Collapse file
test/async-hooks/test-graph.http.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-graph.http.js+2-11Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
38 | 38 | |
39 | 39 | |
40 | 40 | |
41 | | - |
42 | | - |
43 | | - |
44 | 41 | |
45 | 42 | |
46 | 43 | |
47 | 44 | |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
| 45 | + |
52 | 46 | |
53 | 47 | |
54 | 48 | |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
| 49 | + |
59 | 50 | |
60 | 51 | |
61 | 52 | |
|
0 commit comments