feat(net): Timeout resilience layer (Slice 1, PR 2)#78
Conversation
Response-future-only timeout (bounds the send, not the permit wait, per ADR-0031 §1); RequestTimeout per-request override with layer default; body-transparent; TimeoutBody deferred (inert on IBKR's buffered traffic). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds a ChangesTimeout Resilience Layer
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/adapter/net/http/api/src/timeout.rs`:
- Around line 23-31: The public tuple field on RequestTimeout is undocumented,
which triggers missing_docs under the workspace warning policy and then fails
clippy with -D warnings. Update RequestTimeout in timeout.rs by either adding a
field-level doc comment for the Duration payload or applying an explicit
#[allow(missing_docs)] to this type, keeping the existing type docs intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: fba55cfe-3950-4a90-b0fd-41c7bd2ef3ff
📒 Files selected for processing (6)
CHANGELOG.mdcrates/adapter/net/http/api/src/lib.rscrates/adapter/net/http/api/src/timeout.rsdocs/adr/0034-http-construction-surface-auth-guarded-boot-coverage.mddocs/superpowers/plans/2026-07-04-net-http-timeout-layer.mddocs/superpowers/specs/2026-07-04-net-http-timeout-layer-design.md
Add a field-level doc comment to RequestTimeout(pub Duration). Note: this was NOT a CI failure — missing_docs does not lint positional tuple-struct fields (just ci was green with it undocumented), contrary to the review's premise — but documenting the public field is a harmless improvement. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closes #77
Slice 1 PR 2 of the net-http resilience layers (spec: docs/superpowers/specs/2026-07-04-net-http-timeout-layer-design.md; ADR-0031 §1). Builds on the RateLimit layer (#76).
Timeout<S, T>+TimeoutLayer<T>(net-api::Layer) — bounds the send (inner call → response), not the pacing-permit wait (ADR-0031 §1): a response-future race againstTimer::sleep, returningHttpError::Timeoutwhen the deadline wins (inner future dropped). Body-transparent —http::Response<B>returned untouched (noB: Bodybound).RequestTimeout(Duration)per-request override extension — absent → the layer default (not fail-closed: a missing override has no fail-open pacing hazard, unlikeRateScope).TimeoutBodyis deferred — inert on IBKR's all-buffered responses; a clean additive follow-up when a streaming venue lands.Runtime-neutral: generic over
net-api::Timer, race viafutures-util— notokio/hyper. No new dependency. MockTimer-driven tests with inline service doubles (noMockClient— dev-dep cycle). ADR-0034 gains append-only Amendment #6.Next: Slice 1 PR 3 — the
Retrylayer.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Timeoutresilience layer with a configurable default deadline.RequestTimeout(Duration)override for deadline customization.HttpError::Timeout; successful responses pass through unchanged.Documentation