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

Make gRPC ServerParameters configurable #499

Merged

Conversation

abatilo
Copy link
Contributor

@abatilo abatilo commented Sep 3, 2022

Which problem is this PR solving

At the moment, there is no way to override the ServerParameters used in
the keepalive configuration of the gRPC server. As to @bdarfler's
comments in #263, issues can arise where new hosts will never be
connected to because clients will reconnect to already existing hosts
and by the time replacement hosts are available, all clients will have
reconnected to existing hosts with a
MaxConnectionAge/MaxConnectionAgeGrace of
infinity.

Short description of the changes

The changes made are to plumb through the configuration of the GRPC
ServerParameters from the viper configuration and into the instantiation
of the actual gRPC server. These changes kept the previous default
configuration of refinery as the defaults of the configurable settings,
so anyone who doesn't explicitly override any of these configurations
should have exactly the same behavior.

Closes #263

Copy link
Contributor

@kentquirk kentquirk left a comment

Choose a reason for hiding this comment

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

I like this a lot. Please check the default thing, but otherwise I'm ready to approve this.


# After a duration of this time if the server doesn't see any activity it
# pings the client to see if the transport is still alive.
# If set below 1s, a minimum value of 1s will be used instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the docs here, the lower limit is 10s, not 1s, unless I'm reading the wrong thing. Can you check please, and also note the meaning of 0s?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out @kentquirk! Although, it looks like what you linked to is for the ClientParameters.

I grabbed the comments here for the ServerParameters.

I've also pushed a commit for adding notes about the meaning of 0s!

@MikeGoldsmith MikeGoldsmith added type: enhancement New feature or request version: bump minor A PR that adds behavior, but is backwards-compatible. labels Sep 6, 2022
Copy link
Contributor

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

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

As per @kentquirk's request. Please check min value and update docs 👍🏻

@MikeGoldsmith MikeGoldsmith added the status: revision needed Waiting for response to changes requested. label Sep 6, 2022
@abatilo abatilo requested review from MikeGoldsmith and kentquirk and removed request for emilyashley, MikeGoldsmith and kentquirk September 6, 2022 14:49
@abatilo
Copy link
Contributor Author

abatilo commented Sep 6, 2022

I think there might be a bug with GitHub. I tried to re-request reviews from both @kentquirk and @MikeGoldsmith but it seems to have removed @emilyashley and then says I need to re-request review from either Kent or Mike. And if I re-request one, the other gets shown as needing a re-request.

image

Whatever GitHub did, I updated the docs and commented about the min value in question!

Copy link
Contributor

@kentquirk kentquirk left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

@kentquirk kentquirk added status: revision needed Waiting for response to changes requested. and removed status: revision needed Waiting for response to changes requested. labels Sep 6, 2022
Aaron Batilo added 2 commits September 6, 2022 17:20
Which problem is this PR solving
--------------------------------

At the moment, there is no way to override the ServerParameters used in
the `keepalive` configuration of the gRPC server. As to @bdarfler's
comments in honeycombio#263, issues can arise where new hosts will never be
connected to because clients will reconnect to already existing hosts
and by the time replacement hosts are available, all clients will have
reconnected to existing hosts with a
`MaxConnectionAge`/`MaxConnectionAgeGrace` of
[infinity](https://github.com/grpc/grpc-go/blob/60a3a7e969c401ca16dbcd0108ad544fb35aa61c/internal/transport/defaults.go#L36-L37).

Short description of the changes
--------------------------------

The changes made are to plumb through the configuration of the GRPC
ServerParameters from the viper configuration and into the instantiation
of the actual gRPC server. These changes kept the previous default
configuration of refinery as the defaults of the configurable settings,
so anyone who doesn't explicitly override any of these configurations
should have exactly the same behavior.

Closes honeycombio#263
@abatilo abatilo force-pushed the aaron.grpc-server-parameters branch 3 times, most recently from afe5d56 to d9d00d7 Compare September 6, 2022 23:27
Let's explicitly explain what 0 values mean for every field.
@abatilo abatilo force-pushed the aaron.grpc-server-parameters branch from d9d00d7 to 7b400f5 Compare September 6, 2022 23:28
Copy link
Contributor

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @abatilo 👍🏻

@MikeGoldsmith MikeGoldsmith merged commit f755add into honeycombio:main Sep 7, 2022
ghost pushed a commit to opsramp/tracing-proxy that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: revision needed Waiting for response to changes requested. type: enhancement New feature or request version: bump minor A PR that adds behavior, but is backwards-compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make grpc ServerParameters configurable
3 participants