Commit 03d9b91
authored
fix: Add IPv6 support for bind parameter (#240)
* fix: Add IPv6 support for bind parameter
Fixes two IPv6-related bugs when using bind='::':
1. Log message construction: Previously created invalid URL
'http://:::24231' instead of 'http://[::]:24231'
2. Worker aggregation: When bind is '::', the code tried to
connect to '::' directly instead of converting it to '::1'
(IPv6 localhost), causing connection failures
Changes:
- Add bracket notation for IPv6 addresses in log messages
- Convert '::' to '::1' for inter-worker communication
- Maintain backward compatibility with IPv4 addresses
Fixes #229
Signed-off-by: Jesse Awan <jesse.awan@sap.com>
* test: add IPv6 integration tests with shared examples
- Add ipv6_enabled? helper to detect IPv6 support
- Add integration tests for IPv6 loopback (::1), any (::), and pre-bracketed addresses
- Refactor tests using shared_examples pattern to reduce duplication (60 → 35 lines)
- Handle pre-bracketed addresses by stripping brackets before socket binding
- Pass bracketed IPv6 addresses to http_server helper for proper URI construction
- All IPv6 tests pass on systems with IPv6 support, skip gracefully otherwise
- Add /vendor/ to .gitignore for local bundle installations
Signed-off-by: Jesse Awan <jesse.awan@sap.com>
* fix: bind raw IPv6, drop unit tests
Signed-off-by: Jesse Awan <jesse.awan@sap.com>
* fix: Support IPv6 bind addresses in prometheus input plugin
- Route IPv6 addresses to webrick (http_server helper can't construct IPv6 URIs)
- Add IPv6 + TLS guard (raises clear ConfigError for unsupported combination)
- Fix start_webrick to handle non-SSL cases (prevents NoMethodError)
- Add IPv6 URI bracketing in async_wrapper (formats as http://[::1]:port)
- Add test for IPv6 + TLS error case
- Fix FULL_CONFIG -> LOCAL_CONFIG in multi-worker test (FULL_CONFIG was undefined)
Fixes Ruby 3.4 test failures with IPv6 addresses.
All tests pass: 20 examples, 0 failures
Signed-off-by: Jesse Awan <jesse.awan@sap.com>
* Revert unrelated FULL_CONFIG change
This line should not have been touched as part of the IPv6 fix.
Keeping the original FULL_CONFIG as requested.
Signed-off-by: Jesse Awan <jesse.awan@sap.com>
---------
Signed-off-by: Jesse Awan <jesse.awan@sap.com>1 parent b3cd6ff commit 03d9b91
File tree
5 files changed
+131
-23
lines changed- lib/fluent/plugin
- in_prometheus
- spec
- fluent/plugin
5 files changed
+131
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
76 | 89 | | |
77 | 90 | | |
78 | 91 | | |
| |||
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| 126 | + | |
| 127 | + | |
113 | 128 | | |
114 | 129 | | |
115 | 130 | | |
| |||
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
| 145 | + | |
130 | 146 | | |
131 | 147 | | |
132 | 148 | | |
| |||
138 | 154 | | |
139 | 155 | | |
140 | 156 | | |
141 | | - | |
142 | | - | |
143 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
144 | 163 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
149 | 168 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
154 | 173 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
159 | 178 | | |
160 | | - | |
161 | | - | |
162 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
163 | 183 | | |
164 | 184 | | |
165 | 185 | | |
| |||
207 | 227 | | |
208 | 228 | | |
209 | 229 | | |
210 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
211 | 240 | | |
212 | 241 | | |
213 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
11 | | - | |
| 18 | + | |
12 | 19 | | |
13 | | - | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
92 | 108 | | |
93 | 109 | | |
94 | 110 | | |
| |||
278 | 294 | | |
279 | 295 | | |
280 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
281 | 334 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments