Skip to content

fix(csharp): set default socket buffer size to OS default - #4013

Merged
spetz merged 4 commits into
apache:masterfrom
richardcocks:socket-buffer-default
Sep 1, 2026
Merged

fix(csharp): set default socket buffer size to OS default#4013
spetz merged 4 commits into
apache:masterfrom
richardcocks:socket-buffer-default

Conversation

@richardcocks

Copy link
Copy Markdown
Contributor

Closes #4010

Rationale

The previous default buffer size was too small, affecting throughput.

What changed?

A null value for the socket buffer will cause the OS to auto-size the buffer, rather than being a fixed small buffer. Configuration and Builder validation now accepts null, but still validates for positive integers when set.

AI Usage

AI was used to quickly scaffold benchmarks, discover and diagnose the issue, as well as quickly validate the fix-shape, but all code in this PR was hand-edited.

Fixes an issue where the default buffer size was too small in the .NET SDK.
@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Aug 31, 2026
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.33333% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.97%. Comparing base (831b2a6) to head (b06ff7b).

Files with missing lines Patch % Lines
...SDK/IggyClient/Implementations/TcpMessageStream.cs 0.00% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4013      +/-   ##
============================================
- Coverage     85.13%   84.97%   -0.17%     
  Complexity     1402     1402              
============================================
  Files          1226     1225       -1     
  Lines        181308   179238    -2070     
  Branches     147612   145532    -2080     
============================================
- Hits         154359   152307    -2052     
- Misses        22902    22933      +31     
+ Partials       4047     3998      -49     
Components Coverage Δ
Rust Core 85.87% <ø> (-0.20%) ⬇️
Java SDK 67.29% <ø> (ø)
C# SDK 75.45% <73.33%> (+0.07%) ⬆️
Python SDK 90.06% <ø> (ø)
PHP SDK 85.65% <ø> (ø)
Node SDK 96.24% <ø> (ø)
Go SDK 69.31% <ø> (ø)
Files with missing lines Coverage Δ
...p/Iggy_SDK/Configuration/IggyClientConfigurator.cs 100.00% <100.00%> (ø)
...n/csharp/Iggy_SDK/Consumers/IggyConsumerBuilder.cs 81.76% <100.00%> (+3.52%) ⬆️
...gn/csharp/Iggy_SDK/Consumers/IggyConsumerConfig.cs 100.00% <100.00%> (ø)
...reign/csharp/Iggy_SDK/Factory/IggyClientFactory.cs 95.00% <100.00%> (+1.25%) ⬆️
...csharp/Iggy_SDK/Publishers/IggyPublisherBuilder.cs 50.93% <100.00%> (+2.80%) ⬆️
.../csharp/Iggy_SDK/Publishers/IggyPublisherConfig.cs 100.00% <100.00%> (ø)
...SDK/IggyClient/Implementations/TcpMessageStream.cs 80.26% <0.00%> (-0.82%) ⬇️

... and 75 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hubcio hubcio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

foreign/csharp/Benchmarks/Program.cs still pins int.MaxValue per OS. worth re-measuring against the new default and dropping the override if it no longer buys anything.

Comment thread foreign/csharp/Iggy_SDK/Configuration/IggyClientConfigurator.cs Outdated
Comment thread foreign/csharp/Iggy_SDK/Consumers/IggyConsumerConfig.cs Outdated
Comment thread foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs Outdated
Comment thread foreign/csharp/Iggy_SDK/Consumers/IggyConsumerBuilder.cs
Comment thread foreign/csharp/README.md Outdated
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Sep 1, 2026
@spetz

spetz commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Thank you for the contribution, I pushed a few more fixes, so that we could merge this before the upcoming release :)

@spetz
spetz merged commit 2783907 into apache:master Sep 1, 2026
58 checks passed
@github-actions github-actions Bot removed the S-waiting-on-author PR is waiting on author response label Sep 1, 2026
@richardcocks
richardcocks deleted the socket-buffer-default branch September 1, 2026 19:33
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.

[dotnet] Default Send / Recieve TCP buffer is very small, impacting throughput

3 participants