Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughSummary by CodeRabbit发布说明 v0.1.3-rc.11
总体概览本变更实现了HTTP/3 Phase 7发布,包括0-RTT早期数据支持、连接重试、运行时遥测和配置验证。更新了版本至0.1.3-rc.11,添加了多个发布门控脚本,扩展了管理员接口以报告HTTP/3相关指标。 变更清单
序列图sequenceDiagram
participant Client
participant ServerAccept as HTTP/3 Accept<br/>Loop
participant KeyMgmt as Host Key<br/>Management
participant TlsLayer as TLS<br/>Handshake
participant EarlyData as Early Data<br/>Check
participant Router as Route<br/>Dispatch
participant Response as Response<br/>Handler
Client->>ServerAccept: QUIC Initial Packet
ServerAccept->>KeyMgmt: Load/Create host key
KeyMgmt->>KeyMgmt: Persist to disk<br/>(atomic rename)
KeyMgmt-->>ServerAccept: Key material ready
ServerAccept->>ServerAccept: Issue QUIC retry<br/>(if configured)
ServerAccept->>TlsLayer: TLS 1.3 handshake
alt Early Data Enabled
Client->>TlsLayer: 0-RTT with early data
TlsLayer->>EarlyData: Check route.allow_early_data
alt Route allows early data
EarlyData->>Router: Route request
Router->>Response: Generate response
Response-->>Client: 200 OK
Note over EarlyData: Record accepted
else Route rejects early data
EarlyData-->>Client: 425 Too Early
Note over EarlyData: Record rejected
end
else Early Data Disabled or No Early Data
Client->>TlsLayer: Regular handshake completion
TlsLayer->>Router: Route request normally
Router->>Response: Generate response
Response-->>Client: 200 OK
end
ServerAccept->>ServerAccept: Record connection close reason
Note over ServerAccept: Telemetry: active connections,<br/>retry issued/failed, request errors
估计代码审查工作量🎯 5 (Critical) | ⏱️ ~120 分钟 可能相关的PR
诗歌
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Prepares the v0.1.3-rc.11 release candidate by finishing HTTP/3 Phase 6/7 work (0-RTT + replay-safety, QUIC/HTTP/3 runtime telemetry, retry/host-key support), adding dedicated HTTP/3 release-gate/soak automation, and updating operator-facing outputs (status/traffic/snapshot/check) plus release docs/workflows.
Changes:
- Add HTTP/3 0-RTT support with route-level replay-safety enforcement and new counters/telemetry surfaced via admin/status/traffic/snapshot.
- Add QUIC runtime configuration controls (streams/buffers/CID limits/migration, retry + host key material) and improve listener UDP socket handling for accept-workers/reuseport.
- Add HTTP/3-focused gate/soak scripts and wire them into release preparation + GitHub release workflow; update release notes/docs accordingly.
Reviewed changes
Copilot reviewed 56 out of 57 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/run-http3-soak.sh | New focused HTTP/3 soak runner with optional netem/MTU fault injection. |
| scripts/run-http3-release-gate.sh | New Phase 7 release-gate wrapper (gate + soak + optional nginx compare). |
| scripts/run-http3-phase0.sh | New baseline runner for Phase 0 style HTTP/3 smoke/soak subset. |
| scripts/run-http3-gate.sh | New dedicated HTTP/3 regression gate test matrix runner. |
| scripts/prepare-release.sh | Runs the HTTP/3 release gate during release preflight. |
| RELEASE_NOTES_v0.1.3-rc.11.md | Adds release notes for v0.1.3-rc.11. |
| README.md | Bumps displayed version and updates HTTP/3 plan/gate command documentation. |
| crates/rginx-runtime/src/restart.rs | Extends restart FD inheritance to handle multiple UDP sockets per HTTP/3 listener. |
| crates/rginx-runtime/src/bootstrap/shutdown.rs | Updates test fixtures for the new allow_early_data route field. |
| crates/rginx-runtime/src/bootstrap/listeners.rs | Binds per-worker UDP sockets (reuseport) and starts multiple HTTP/3 accept workers/endpoints. |
| crates/rginx-runtime/src/admin.rs | Bumps admin snapshot schema version to 13. |
| crates/rginx-runtime/Cargo.toml | Adds socket2 dependency for UDP socket options/binding. |
| crates/rginx-http/src/transition.rs | Updates tests to include newly added HTTP/3 listener config fields. |
| crates/rginx-http/src/tls/acceptor.rs | Enables HTTP/3 early-data via rustls config and relaxes prior client-auth restriction. |
| crates/rginx-http/src/state/traffic.rs | Adds listener-level HTTP/3 runtime telemetry to traffic snapshots. |
| crates/rginx-http/src/state/tls_runtime/listeners.rs | Adds HTTP/3 transport/runtime config fields to TLS listener status snapshots. |
| crates/rginx-http/src/state/tests.rs | Adds/updates tests for HTTP/3 runtime telemetry and early-data counters. |
| crates/rginx-http/src/state/snapshots.rs | Extends snapshot schema with HTTP/3 telemetry, early-data counters, and binding metadata. |
| crates/rginx-http/src/state/lifecycle.rs | Populates new HTTP/3 telemetry fields in runtime status snapshots. |
| crates/rginx-http/src/state/helpers.rs | Adds helper to render HTTP/3 runtime telemetry snapshots from counters. |
| crates/rginx-http/src/state/counters.rs | Adds HTTP/3 active/total counters and early-data accepted/rejected counters. |
| crates/rginx-http/src/state/connections.rs | Adds guards and recorders for HTTP/3 active streams/connections, retry/errors, and early-data acceptance/rejection. |
| crates/rginx-http/src/server/http3.rs | Implements downstream HTTP/3 retry, host-key material, QUIC runtime tuning, early-data tracking, and richer telemetry. |
| crates/rginx-http/src/server/connection.rs | Adds early_data into connection metadata; exposes TLS handshake failure classifier to HTTP/3 path. |
| crates/rginx-http/src/router.rs | Updates tests for the new allow_early_data route field. |
| crates/rginx-http/src/proxy/clients/http3.rs | Reworks upstream HTTP/3 client to reuse endpoints/sessions and stream response bodies (avoid full buffering). |
| crates/rginx-http/src/handler/tests.rs | Updates handler tests for the new allow_early_data route field and connection metadata. |
| crates/rginx-http/src/handler/response.rs | Adds a 425 Too Early response helper. |
| crates/rginx-http/src/handler/mod.rs | Injects early-data boolean into request extensions for downstream dispatch decisions. |
| crates/rginx-http/src/handler/dispatch.rs | Enforces replay-safe routing for 0-RTT and records accepted/rejected early-data metrics. |
| crates/rginx-http/src/client_ip.rs | Extends connection peer metadata with early_data. |
| crates/rginx-http/Cargo.toml | Adds aws-lc-rs and quinn-proto for QUIC token/reset/CID generation support. |
| crates/rginx-core/src/config/tests.rs | Updates config tests for enriched HTTP/3 binding fields and allow_early_data. |
| crates/rginx-core/src/config/route.rs | Adds allow_early_data to compiled Route model. |
| crates/rginx-core/src/config.rs | Extends ListenerHttp3 + ListenerTransportBinding with QUIC runtime settings and early-data flags. |
| crates/rginx-config/src/validate/tests.rs | Adds validation coverage for new HTTP/3 transport settings and early-data constraints. |
| crates/rginx-config/src/validate/server.rs | Validates new HTTP/3 fields (streams/buffers/CID limit/retry/host-key/early-data prerequisites). |
| crates/rginx-config/src/model.rs | Extends config model for HTTP/3 tuning and route-level allow_early_data. |
| crates/rginx-config/src/compile/tests.rs | Adds compile tests for HTTP/3 defaults and host-key path resolution; updates fixtures for new route field. |
| crates/rginx-config/src/compile/server.rs | Compiles HTTP/3 tuning fields with defaults; resolves host-key paths relative to base dir. |
| crates/rginx-config/src/compile/route.rs | Compiles allow_early_data into runtime Route. |
| crates/rginx-app/tests/support/mod.rs | Improves test HTTP response parsing (content-length + chunked decoding). |
| crates/rginx-app/tests/http3.rs | Adds end-to-end HTTP/3 tests for mTLS, retry/host-key persistence, early-data replay gating, and telemetry. |
| crates/rginx-app/tests/check.rs | Updates check integration test expectations for new HTTP/3 fields/output. |
| crates/rginx-app/tests/admin/snapshot.rs | Updates snapshot tests for schema v13 and new HTTP/3 snapshot fields. |
| crates/rginx-app/tests/admin/commands.rs | Updates admin CLI tests for new HTTP/3 telemetry and counters output. |
| crates/rginx-app/src/main.rs | Extends check summary output with HTTP/3 early-data enabled listener count + per-binding metadata. |
| crates/rginx-app/src/admin_cli/traffic.rs | Prints HTTP/3 runtime telemetry in traffic output. |
| crates/rginx-app/src/admin_cli/status.rs | Prints HTTP/3 summary metrics, per-binding metadata, and per-listener HTTP/3 telemetry in status output. |
| crates/rginx-app/src/admin_cli/counters.rs | Prints new HTTP/3 early-data counters in counters output. |
| Cargo.toml | Bumps workspace version to 0.1.3-rc.11. |
| Cargo.lock | Updates lockfile for new/updated dependencies and version bump. |
| ARCHITECTURE_REMEDIATION_RELEASE_NOTE.md | Removes obsolete remediation release note doc. |
| ARCHITECTURE_REMEDIATION_PLAN.md | Removes obsolete remediation plan doc. |
| ARCHITECTURE_HTTP3_PLAN.md | Removes older HTTP/3 plan doc in favor of nginx-alignment plan/phase docs. |
| ARCHITECTURE_HTTP3_PHASE0_FREEZE.md | Removes older Phase 0 freeze doc in favor of updated docs. |
| .github/workflows/release.yml | Runs HTTP/3 release gate during release verification. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [[ "${need_privileged}" -eq 1 ]]; then | ||
| have tc || die "tc is required when --netem-profile is used" | ||
| have ip || die "ip is required when --mtu is used" | ||
| [[ "${EUID}" -eq 0 ]] || die "root privileges are required for netem/mtu operations" | ||
| fi |
There was a problem hiding this comment.
The privileged-tool checks are slightly inconsistent: need_privileged becomes true when only --mtu is set, but the script still hard-requires tc and will run tc qdisc del ... in clear_faults even though netem isn't in use. This makes --mtu unnecessarily depend on tc (and can break on minimal systems). Consider gating the tc requirement/usage on NETEM_PROFILE != none and only requiring ip/doing MTU work when --mtu is set.
| rustls-native-certs.workspace = true | ||
| serde.workspace = true | ||
| serde_json.workspace = true | ||
| socket2 = "0.5.10" | ||
| tokio = { workspace = true, features = ["io-util", "process"] } |
There was a problem hiding this comment.
This adds a direct socket2 = "0.5.10" dependency, but the workspace already pulls in socket2 0.6.x transitively (e.g., via tokio/quinn), so this introduces a second socket2 version in the build. To reduce compile time and dependency duplication, consider adding socket2 to [workspace.dependencies] and using socket2.workspace = true here (matching the existing version), unless there is a specific reason to pin 0.5.x.
| let size_hint = response_size_hint(&parts.headers); | ||
| let expect_trailers = response_expects_trailers(&parts.headers); | ||
| let body = streaming_response_body( | ||
| request_stream, | ||
| session, | ||
| peer.url.clone(), | ||
| size_hint, | ||
| expect_trailers, | ||
| ); |
There was a problem hiding this comment.
The new upstream HTTP/3 path only calls recv_trailers() when Content-Type looks like gRPC. Previously trailers were always read and forwarded; with this change, any non-gRPC response trailers will be silently dropped, and (depending on h3/quinn semantics) the stream may not be fully driven to completion which can interfere with session reuse. Consider always draining/reading trailers (and forwarding them when present), even if you don’t expect them for most content-types.
| config.alpn_protocols = alpn_protocols.into_iter().map(String::into_bytes).collect(); | ||
| apply_session_policy(&mut config, default_tls)?; | ||
| if http3_only && http3_early_data_enabled { | ||
| config.max_early_data_size = u32::MAX; | ||
| } |
There was a problem hiding this comment.
Setting config.max_early_data_size = u32::MAX enables up to ~4GB of 0-RTT data per connection, which is a very permissive default and can have DoS / memory-pressure implications. Consider bounding this to a reasonable limit (e.g., derived from the configured max request body size) and/or disabling early data automatically when client auth is configured so the advertised early_data capability matches actual runtime behavior.
| let mtls_configured = | ||
| current_listener.server.tls.as_ref().and_then(|tls| tls.client_auth.as_ref()).is_some(); | ||
| let early_data_enabled = | ||
| current_listener.http3.as_ref().is_some_and(|http3| http3.early_data_enabled); | ||
| let connecting = match incoming.accept() { |
There was a problem hiding this comment.
early_data_enabled is read from listener config, but 0-RTT is skipped whenever downstream mTLS is configured (!mtls_configured). This means a config can advertise/enable HTTP/3 early data while the server will silently never use 0-RTT for that listener. Consider either rejecting http3.early_data when tls.client_auth is set (validation) or making the effective early-data state explicit in status/snapshot so operators aren’t misled.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
v0.1.3-rc.11release candidate0.1.3-rc.11and add repository release notesHighlights
status,traffic, and admin snapshot outputRelease Notes
Validation
./scripts/prepare-release.sh --tag v0.1.3-rc.11 --allow-dirty