Skip to content

fix(http): retain shared buffer across attempts - #249

Merged
thomhurst merged 1 commit into
mainfrom
issue-248-hedge-buffer-race
Aug 24, 2026
Merged

fix(http): retain shared buffer across attempts#249
thomhurst merged 1 commit into
mainfrom
issue-248-hedge-buffer-race

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • keep request-content buffering alive for the full request execution instead of per-attempt waiter lifetimes
  • cancel pending buffering when the overall execution completes or caller cancellation fires
  • make the hedge/attempt-timeout race deterministic in the integration test

Test plan

  • deterministic regression fails before fix with 2 serializations
  • dotnet build Kevlar.slnx -c Release
  • dotnet run --project tests/Kevlar.IntegrationTests -c Release --no-build -- --timeout 5m (123 passed)
  • dotnet run --project tests/Kevlar.NetStandard.Tests -c Release --no-build -- --timeout 5m (10 passed)
  • focused hedge buffering regression repeated 10/10 successfully

Benchmark

BenchmarkDotNet ShortRun, Windows 11, .NET 10.0.11, HttpReplayBenchmarks.BufferedContent_WithRetry:

Mean Allocated
Before 2.247 μs 3.17 KB
After 1.959 μs 3.16 KB

No throughput or allocation regression observed (~13% lower mean in this short local run).

Closes #248

Attempt timeout must stop only that waiter; request execution owns the shared buffer until completion so a scheduled hedge cannot trigger duplicate serialization.

Refs #248
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27abb4c1-d058-4436-9922-0498d92d5c24


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.

❤️ Share

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

@thomhurst
thomhurst merged commit 00e4d85 into main Aug 24, 2026
6 checks passed
@thomhurst
thomhurst deleted the issue-248-hedge-buffer-race branch August 24, 2026 19:11
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.

fix(http): eliminate hedge shared-buffer race

1 participant