Commit 64f15c2
http: fix leaked error listener on sync HTTP req create + destroy
Previously, this resulted in an error listener being added but not
cleaned up when the socket was freed back to the agent pool.
This also updates the docs to clarify when req.destroy() kills the
underlying socket - only if it's called during request processing (more
specifically: after onSocketNT, at which point we may have started
reading & writing).
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: #62872
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>1 parent d142c58 commit 64f15c2Copy full SHA for 64f15c2
3 files changed
+53-1Lines changed: 53 additions & 1 deletion
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- doc/api
- lib
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
954 | 954 | |
955 | 955 | |
956 | 956 | |
957 | | - |
| 957 | + |
| 958 | + |
958 | 959 | |
959 | 960 | |
960 | 961 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
999 | 999 | |
1000 | 1000 | |
1001 | 1001 | |
| 1002 | + |
1002 | 1003 | |
1003 | 1004 | |
1004 | 1005 | |
|
Collapse file
test/parallel/test-http-client-request-listeners-leak.js
Copy file name to clipboard+50Lines changed: 50 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 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
0 commit comments