Skip to content

grpc: introduce new DialOption and ServerOption to configure initial window size without disabling BDP estimation. #8283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

vinothkumarr227
Copy link
Contributor

@vinothkumarr227 vinothkumarr227 commented May 2, 2025

Fixes: #7923

  • Added new DialOptions to configure static window sizes without disabling BDP estimation:

    • WithStaticStreamWindowSize(int32) — sets the initial stream window size
    • WithStaticConnWindowSize(int32) — sets the initial connection window size
  • Added new ServerOptions to configure static window sizes without disabling BDP estimation:

    • StaticStreamWindowSize(int32) — sets the initial stream window size
    • StaticConnWindowSize(int32) — sets the initial connection window size

These options mirror the behavior of WithInitialWindowSize and InitialConnWindowSize,. The original options will continue to disable BDP estimation as before.

RELEASE NOTES:

  • grpc: introduce new DialOption and ServerOption to configure initial window size without disabling BDP estimation.

Copy link

codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 35.71429% with 18 lines in your changes missing coverage. Please review.

Project coverage is 82.15%. Comparing base (6821606) to head (68f1322).
Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
server.go 0.00% 8 Missing ⚠️
internal/transport/http2_client.go 0.00% 2 Missing and 4 partials ⚠️
internal/transport/http2_server.go 33.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8283      +/-   ##
==========================================
- Coverage   82.25%   82.15%   -0.10%     
==========================================
  Files         417      419       +2     
  Lines       41356    42014     +658     
==========================================
+ Hits        34017    34517     +500     
- Misses       5923     6024     +101     
- Partials     1416     1473      +57     
Files with missing lines Coverage Δ
dialoptions.go 91.08% <100.00%> (+0.28%) ⬆️
internal/transport/transport.go 91.56% <ø> (ø)
internal/transport/http2_server.go 90.85% <33.33%> (-0.24%) ⬇️
internal/transport/http2_client.go 91.94% <0.00%> (-0.36%) ⬇️
server.go 82.07% <0.00%> (-0.60%) ⬇️

... and 56 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arjan-bal
Copy link
Contributor

Is this the same as #8279? Should the original PR be closed?

@vinothkumarr227
Copy link
Contributor Author

Is this the same as #8279? Should the original PR be closed?
Yeah, you can close this PR: #8279.

@vinothkumarr227
Copy link
Contributor Author

@dfawley Can you please review this when you get a chance?

@purnesh42H purnesh42H requested a review from dfawley May 9, 2025 11:17
@purnesh42H purnesh42H assigned dfawley and unassigned vinothkumarr227 May 9, 2025
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

This PR should implement just (1) from #7923.

It should not mark the old options as deprecated.

  • Please improve the PR title ("the size"?)
  • Please write release notes

Thanks!

@dfawley dfawley assigned vinothkumarr227 and unassigned dfawley May 9, 2025
@vinothkumarr227 vinothkumarr227 changed the title Add new Dial/ServerOptions to set the size grpc: add DialOption and ServerOption to configure initial window size without disabling BDP estimation May 12, 2025
@vinothkumarr227 vinothkumarr227 requested a review from dfawley May 13, 2025 06:25
@purnesh42H purnesh42H changed the title grpc: add DialOption and ServerOption to configure initial window size without disabling BDP estimation grpc: introduce new DialOption and ServerOption to configure initial window size without disabling BDP estimation. May 13, 2025
@purnesh42H purnesh42H added Type: Feature New features or improvements in behavior Area: RPC Features Includes Compression, Encoding, Attributes/Metadata, Interceptors. and removed Status: Requires Reporter Clarification labels May 13, 2025
@purnesh42H purnesh42H added this to the 1.73 Release milestone May 13, 2025
@vinothkumarr227
Copy link
Contributor Author

This PR should implement just (1) from #7923.

It should not mark the old options as deprecated.

  • Please improve the PR title ("the size"?)
  • Please write release notes

Thanks!

@dfawley Could you please re-review this PR? I've made the changes.

Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

And please update the first comment and release notes in this PR accordingly.

Comment on lines +151 to +153
// TestJoinDialOption_StaticConnAndStreamWindowSizes verifies that both static
// stream and connection window sizes set via joined dial options are correctly
// applied.
Copy link
Member

Choose a reason for hiding this comment

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

Is there some special interaction here with these and Join? I don't think there's much need for this test, since it just tests Join, but we already have a test for that.

Comment on lines +228 to +229
// WithStaticStreamWindowSize returns a DialOption to set the static initial
// stream window size.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// WithStaticStreamWindowSize returns a DialOption to set the static initial
// stream window size.
// WithStaticStreamWindowSize returns a DialOption which sets the initial
// stream window size to the value provided and prevents dynamic flow control
// from adjusting it.

StatsHandlers []stats.Handler
KeepaliveParams keepalive.ServerParameters
KeepalivePolicy keepalive.EnforcementPolicy
InitialWindowSize int32
Copy link
Member

Choose a reason for hiding this comment

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

I think it would help things for this change if we were to delete the Initial things from our internals for now. Conceptually, the current settings are just renamed to Static.

@dfawley dfawley removed their assignment May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: RPC Features Includes Compression, Encoding, Attributes/Metadata, Interceptors. Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a way to adjust the initial window size that does not also disable BDP estimation
4 participants