Commit ac63021
authored
fix: detect client disconnect on timeout in ensure_completed (#566)
* chore: trigger CI rebuild
* chore: trigger CI retry for flaky test
* fix: detect client disconnect on timeout in ensure_completed
When Bandit drains remaining body data after a controller returns
(via ensure_completed), timeouts would always raise HTTPError even
if the client had disconnected. This caused spurious error reports.
This commit:
1. Extracts the client-disconnect detection logic into a reusable
handle_timeout_with_disconnect_check!/1 function
2. Applies the same detection in ensure_completed, converting
timeouts to TransportError when the client has disconnected
This ensures that client disconnects during body draining are
properly classified as TransportError (which can be ignored in
error tracking) rather than HTTPError.
* chore: trigger CI retry for flaky tests
* chore: retry CI
* chore: retry CI for flaky HTTP/2 test
* test: add ensure_completed disconnect regression coverage
* chore: retry CI after flaky server startup log test
* test: stabilize malformed target bad-request assertions1 parent c746d8e commit ac63021
File tree
2 files changed
+79
-24
lines changed- lib/bandit/http1
- test/bandit/http1
2 files changed
+79
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 319 | + | |
337 | 320 | | |
338 | 321 | | |
339 | 322 | | |
340 | 323 | | |
341 | 324 | | |
342 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
343 | 348 | | |
344 | 349 | | |
345 | 350 | | |
| |||
453 | 458 | | |
454 | 459 | | |
455 | 460 | | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
456 | 470 | | |
457 | 471 | | |
458 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
491 | | - | |
492 | | - | |
| 490 | + | |
| 491 | + | |
493 | 492 | | |
494 | 493 | | |
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
498 | 497 | | |
499 | 498 | | |
500 | | - | |
501 | | - | |
502 | | - | |
| 499 | + | |
| 500 | + | |
503 | 501 | | |
504 | 502 | | |
505 | 503 | | |
506 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
507 | 520 | | |
508 | 521 | | |
509 | 522 | | |
| |||
955 | 968 | | |
956 | 969 | | |
957 | 970 | | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
958 | 999 | | |
959 | 1000 | | |
960 | 1001 | | |
| |||
0 commit comments