Commit 5dc39a1
http: reuse socket only when it is drained
Ensuring every request is assigned to a drained socket or nothing.
Because is has no benifit for a request to be attached to a non
drained socket and it prevents the request from being assigned to
a drained one, which might occur soon or already in the free pool
We achieve this by claiming a socket as free only when the socket
is drained.
PR-URL: #43902
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Robert Nagy <ronagy@icloud.com>1 parent 04fdc3e commit 5dc39a1Copy full SHA for 5dc39a1
File tree
Expand file treeCollapse file tree
3 files changed
+134
-4
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+134
-4
lines changedOpen diff view settings
Collapse file
+9-3Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
665 | 665 | |
666 | 666 | |
667 | 667 | |
668 | | - |
| 668 | + |
669 | 669 | |
670 | 670 | |
671 | 671 | |
| ||
737 | 737 | |
738 | 738 | |
739 | 739 | |
740 | | - |
| 740 | + |
| 741 | + |
741 | 742 | |
742 | 743 | |
743 | 744 | |
744 | 745 | |
745 | 746 | |
| 747 | + |
| 748 | + |
| 749 | + |
746 | 750 | |
747 | 751 | |
748 | 752 | |
| ||
755 | 759 | |
756 | 760 | |
757 | 761 | |
758 | | - |
| 762 | + |
| 763 | + |
| 764 | + |
759 | 765 | |
760 | 766 | |
761 | 767 | |
|
Collapse file
+3-1Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
985 | 985 | |
986 | 986 | |
987 | 987 | |
| 988 | + |
| 989 | + |
988 | 990 | |
989 | 991 | |
990 | 992 | |
| ||
1008 | 1010 | |
1009 | 1011 | |
1010 | 1012 | |
1011 | | - |
| 1013 | + |
1012 | 1014 | |
1013 | 1015 | |
1014 | 1016 | |
|
Collapse file
test/parallel/test-http-agent-reuse-drained-socket-only.js
Copy file name to clipboard+122Lines changed: 122 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 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
0 commit comments