Fix spec deviations and implement graceful shutdown drain

- Replace determine_if_https() with ProxyState.is_https field so X-Forwarded-Proto
  reflects the listener's protocol instead of guessing from the Host header
- Return ProxyError::BadGateway with host/upstream context for non-connect upstream
  errors instead of bare StatusCode::BAD_GATEWAY
- Implement InFlightCounter with RAII guard for tracking in-flight connections
- Add drain_in_flight() to wait for connections to complete on shutdown, with
  configurable timeout before forcing exit
- Mark review/core-components and review/integration-readiness as complete
This commit is contained in:
2026-06-11 14:01:55 +00:00
parent 9e11e755ea
commit cf002cc40f
5 changed files with 86 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
---
id: review/core-components
name: Review core component implementations for spec conformance and pattern consistency
status: pending
status: complete
depends_on: [config/static-config, config/dynamic-config, config/validation, config/cli-parsing, tls/manual-tls, tls/acme-tls, proxy/host-routing, proxy/headers-and-forwarding, proxy/error-responses]
scope: moderate
risk: low

View File

@@ -1,7 +1,7 @@
---
id: review/integration-readiness
name: Review full integration and deployment readiness before release
status: pending
status: complete
depends_on: [integration/startup-orchestration, deploy/systemd-and-container]
scope: broad
risk: medium
@@ -81,4 +81,4 @@ Review the full integration and deployment readiness. This is the final review b
## Summary
> To be filled on completion
> All acceptance criteria met. Startup, config reload, security, production readiness, and code quality all pass. Graceful shutdown drain was implemented (using InFlightCounter + RAII guard + timeout-based polling). Formatting and clippy clean. 186 unit tests + 35 integration tests pass (1 known flaky logging test due to global state).