Skip to content
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

Is ConnectParams still considered an experimental type? #8176

Open
ndsistsys opened this issue Mar 17, 2025 · 7 comments
Open

Is ConnectParams still considered an experimental type? #8176

ndsistsys opened this issue Mar 17, 2025 · 7 comments
Assignees
Labels
Area: Client Includes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more. Type: Question

Comments

@ndsistsys
Copy link

According to https://github.com/grpc/grpc-go/blame/775150f68c1759ad4b1230d09fe41efb6f3c76ad/backoff.go#L53 type ConnectParams should be considered experimental. However, the comment was added 5 years ago, can we consider this type as stable?

@eshitachandwani
Copy link
Member

Hey, @ndsistsys , can you tell us why do you want to use it ? What is your use case ? Since we have it for a long time, there is a less chance to change it but we would still like to reserve the right to change it if necessary.

@eshitachandwani eshitachandwani added Area: Client Includes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more. Status: Requires Reporter Clarification labels Mar 22, 2025
@ndsistsys
Copy link
Author

Hey @eshitachandwani I'm interested in ConnectParams as I'd like to use some kind of backoff approach when trying to create a connection towards a gRPC server, so that a error in the first connection attempt does not make the whole process fail.
As a common strategy to avoid flooding the server with requests, I'd like to use an exponential backoff, setting up some parameters according to my use case.
I'll use a backoff strategy anyway, my doubt was using the capabilities provided by grpc-go or by another package.

Please notice that the internal backoff is mentioned at least in the following files:

// resolution, TCP connection establishment (with retries and backoff) and TLS

// The backoff configuration specified as part of the ConnectParams overrides

Given that the definition of the struct has not change for 5 years, if you don't have anything in your backlog IMHO it would be better to delete the comment about the experimental status, as it can be misleading. At first, I understood some changes were foreseen in a near future.

@dfawley
Copy link
Member

dfawley commented Mar 26, 2025

gRPC does exponential backoff internally automatically. Is there some reason why the default settings aren't working for you?

@ndsistsys
Copy link
Author

I suppose the default values are

var DefaultConfig = Config{

I have use some cases in which I need to change the MaxDelay default value.
Anyway, I'll use ConnectParams in my code base; I would like only to state again that at first, reading the comment about the struct being experimental, I understood it was not stable.
Thank you for your replies!

@dfawley
Copy link
Member

dfawley commented Mar 27, 2025

I have use some cases in which I need to change the MaxDelay default value.

Can you explain why?

I would like only to state again that at first, reading the comment about the struct being experimental, I understood it was not stable.

Correct, it is not stable. At least in part because we haven't really found people needing to use it. I'm fairly sure we would have made it internal-only if we had known better (or maybe internal didn't exist at the time or maybe we didn't know about it?).

Copy link

github-actions bot commented Apr 2, 2025

This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the stale label Apr 2, 2025
@ndsistsys
Copy link
Author

ndsistsys commented Apr 3, 2025

@dfawley

Can you explain why?

In order to setup an optimized configuration, shouldn't we tune the backoff parameters according to a connection deadline?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Client Includes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more. Type: Question
Projects
None yet
Development

No branches or pull requests

4 participants