Commit 33ec556
authored
fix: bound HTTPServer request resources (#2333)
## Summary
- use a fixed-size default executor with a bounded queue and
non-blocking rejection
- close rejected authenticated request bodies instead of draining an
unbounded body
- close rejected exchanges after sending HTTP 403
This is the focused replacement for the #2284 portion of #2297.
Fixes #2284
## Ongoing discussion
None currently. Earlier review feedback about preserving default
concurrency and closing rejected exchanges is incorporated here.
## Validation
- `mise run lint:fix`
- `mise run build`
- `./mvnw test -pl prometheus-metrics-exporter-httpserver
-Dcoverage.skip=true -Dcheckstyle.skip=true`
---------
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>1 parent 6b2f478 commit 33ec556
3 files changed
Lines changed: 35 additions & 101 deletions
File tree
- prometheus-metrics-exporter-httpserver/src
- main/java/io/prometheus/metrics/exporter/httpserver
- test/java/io/prometheus/metrics/exporter/httpserver
Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 11 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
157 | | - | |
| 160 | + | |
158 | 161 | | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | 168 | | |
174 | 169 | | |
175 | 170 | | |
| |||
354 | 349 | | |
355 | 350 | | |
356 | 351 | | |
357 | | - | |
358 | | - | |
| 352 | + | |
| 353 | + | |
359 | 354 | | |
360 | 355 | | |
361 | | - | |
362 | | - | |
363 | | - | |
| 356 | + | |
| 357 | + | |
364 | 358 | | |
365 | 359 | | |
366 | 360 | | |
| |||
Lines changed: 24 additions & 66 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
194 | 176 | | |
195 | 177 | | |
196 | 178 | | |
197 | | - | |
| 179 | + | |
198 | 180 | | |
199 | 181 | | |
200 | 182 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
204 | 190 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 191 | + | |
212 | 192 | | |
213 | 193 | | |
214 | 194 | | |
| |||
274 | 254 | | |
275 | 255 | | |
276 | 256 | | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | 257 | | |
297 | 258 | | |
298 | 259 | | |
| |||
304 | 265 | | |
305 | 266 | | |
306 | 267 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | 268 | | |
311 | 269 | | |
312 | 270 | | |
| |||
0 commit comments