Commit 26d145a
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: #23410
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 0d241ba commit 26d145aCopy full SHA for 26d145a
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 |
|---|---|---|
| ||
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | | - |
| 38 | + |
39 | 39 | |
40 | 40 | |
41 | 41 | |
|
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 |
|---|---|---|
| ||
39 | 39 | |
40 | 40 | |
41 | 41 | |
| 42 | + |
42 | 43 | |
43 | 44 | |
44 | 45 | |
| ||
618 | 619 | |
619 | 620 | |
620 | 621 | |
621 | | - |
| 622 | + |
622 | 623 | |
623 | 624 | |
624 | 625 | |
|
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 | |
| ||
331 | 332 | |
332 | 333 | |
333 | 334 | |
334 | | - |
| 335 | + |
335 | 336 | |
336 | 337 | |
337 | 338 | |
|
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 |
|---|---|---|
| ||
641 | 641 | |
642 | 642 | |
643 | 643 | |
| 644 | + |
644 | 645 | |
645 | 646 | |
646 | 647 | |
| ||
681 | 682 | |
682 | 683 | |
683 | 684 | |
| 685 | + |
| 686 | + |
| 687 | + |
| 688 | + |
| 689 | + |
| 690 | + |
| 691 | + |
| 692 | + |
684 | 693 | |
685 | 694 | |
686 | 695 | |
|
Collapse file
+9-2Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
464 | 464 | |
465 | 465 | |
466 | 466 | |
| 467 | + |
| 468 | + |
| 469 | + |
467 | 470 | |
468 | 471 | |
469 | 472 | |
| ||
472 | 475 | |
473 | 476 | |
474 | 477 | |
475 | | - |
476 | | - |
| 478 | + |
| 479 | + |
| 480 | + |
| 481 | + |
| 482 | + |
| 483 | + |
477 | 484 | |
478 | 485 | |
479 | 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