Skip to content

feat(http): add standard hedging handler - #136

Merged
thomhurst merged 2 commits into
mainfrom
issue-127-standard-hedging-handler
Aug 21, 2026
Merged

feat(http): add standard hedging handler#136
thomhurst merged 2 commits into
mainfrom
issue-127-standard-hedging-handler

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Closes #127.

What changed

  • add AddStandardHedgingShield and bindable StandardHedgingShieldOptions
  • compose total timeout and hedging with endpoint-local concurrency limits, circuit breakers, and attempt timeouts
  • preserve safe replay rules, ordered/weighted routing, state isolation, and exact response/request disposal
  • document the one-line registration and add HTTP benchmarks

Validation

  • dotnet build Kevlar.slnx -c Release --no-restore
  • dotnet run --project tests/Kevlar.Tests -c Release --no-build -- --timeout 5m — 680 passed
  • dotnet run --project tests/Kevlar.IntegrationTests -c Release --no-build -- --timeout 5m — 117 passed
  • npm run build in docs/
  • Verify-Packages.ps1 — layout, consumers, analyzers, trimmed and single-file publish passed; NativeAOT remains Linux-CI-only
  • Verify-DocSnippets.ps1 — 99 snippets compiled and documented behavior executed

Benchmark

ShortRun, .NET 10, HTTP happy path:

Method Mean Allocated
Manual composition 1.964 us 3.41 KB
Standard registration 1.977 us (1.01x) 3.41 KB (1.00x)

Provide one-line endpoint-aware hedging with isolated limiter and breaker state plus safe request replay.
Treat transport Unavailable as deadline-owned when the gRPC deadline has already expired, preserving terminal metadata.
@thomhurst

Copy link
Copy Markdown
Owner Author

Rebased onto #131 and resolved the standard-handler docs/guard overlap by preserving both APIs. The Windows failure reproduced locally as a real gRPC deadline race: TestServer can surface Unavailable after the deadline. Added deterministic coverage and normalized that expired transport status to DeadlineExceeded while preserving trailers. Release build, 685 unit tests, and 118 integration tests pass locally.

@thomhurst
thomhurst force-pushed the issue-127-standard-hedging-handler branch from 418dbd3 to 28e64c6 Compare August 21, 2026 21:58
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thomhurst, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8427343a-1d4c-4029-a8f5-dbce97f56107

📥 Commits

Reviewing files that changed from the base of the PR and between e6327f4 and 28e64c6.

📒 Files selected for processing (10)
  • benchmarks/Kevlar.Benchmarks/HttpStandardHedgingBenchmarks.cs
  • docs/docs/http.md
  • src/Kevlar.Extensions.Grpc/ShieldUnaryClientInterceptor.cs
  • src/Kevlar.Extensions.Http/PublicAPI.Unshipped.txt
  • src/Kevlar.Extensions.Http/ShieldHttpClientBuilderExtensions.cs
  • src/Kevlar.Extensions.Http/StandardHedgingShieldOptions.cs
  • tests/Kevlar.IntegrationTests/GrpcResilienceTests.cs
  • tests/Kevlar.IntegrationTests/HttpReplayTests.cs
  • tests/Kevlar.IntegrationTests/HttpResilienceTests.cs
  • tests/Kevlar.Tests/HttpContractTests.cs

Comment @coderabbitai help to get the list of available commands.

@thomhurst
thomhurst merged commit f9764d4 into main Aug 21, 2026
6 checks passed
@thomhurst
thomhurst deleted the issue-127-standard-hedging-handler branch August 21, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(http): add standard hedging handler

1 participant