Commit 54bd4ab
cluster: fix edge cases that throw ERR_INTERNAL_ASSERTION
Some cases use both `cluster` and `net`/`cluser` will throw
ERR_INTERNAL_ASSERTION when `listen`/`bind` to the port of `0`. This
PR maitains a separate map of the index to fix the issue. See the new
tests added for the detail cases.
PR-URL: #36764
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>1 parent ff5bd04 commit 54bd4abCopy full SHA for 54bd4ab
File tree
Expand file treeCollapse file tree
3 files changed
+98
-14
lines changedOpen diff view settings
Filter options
- lib/internal/cluster
- test/parallel
Expand file treeCollapse file tree
3 files changed
+98
-14
lines changedOpen diff view settings
Collapse file
lib/internal/cluster/child.js
Copy file name to clipboardExpand all lines: lib/internal/cluster/child.js+27-14Lines changed: 27 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
| 9 | + |
9 | 10 | |
10 | 11 | |
11 | 12 | |
| ||
73 | 74 | |
74 | 75 | |
75 | 76 | |
76 | | - |
| 77 | + |
77 | 78 | |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
84 | 85 | |
85 | 86 | |
86 | 87 | |
| ||
100 | 101 | |
101 | 102 | |
102 | 103 | |
103 | | - |
| 104 | + |
104 | 105 | |
105 | | - |
| 106 | + |
106 | 107 | |
107 | 108 | |
108 | 109 | |
| ||
114 | 115 | |
115 | 116 | |
116 | 117 | |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
117 | 130 | |
118 | | - |
| 131 | + |
119 | 132 | |
120 | 133 | |
121 | 134 | |
| ||
124 | 137 | |
125 | 138 | |
126 | 139 | |
127 | | - |
| 140 | + |
128 | 141 | |
129 | 142 | |
130 | 143 | |
131 | 144 | |
132 | 145 | |
133 | 146 | |
134 | 147 | |
135 | | - |
136 | | - |
| 148 | + |
| 149 | + |
137 | 150 | |
138 | 151 | |
139 | 152 | |
| ||
157 | 170 | |
158 | 171 | |
159 | 172 | |
160 | | - |
| 173 | + |
161 | 174 | |
162 | 175 | |
163 | 176 | |
|
Collapse file
test/parallel/test-cluster-child-index-dgram.js
Copy file name to clipboard+40Lines changed: 40 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 | + |
Collapse file
test/parallel/test-cluster-child-index-net.js
Copy file name to clipboard+31Lines changed: 31 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 | + |
0 commit comments