-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Change in GRPC_XDS_BOOTSTRAP
behaviour between grpc-go
versions
#8152
Comments
I suspect the commit that caused the difference is this one 79b6830#diff-8c0a0efa1bb340ffe5846ebebb64f9182dcbb1218d0a51a6b3d6d340072ab07e |
grpc-go
versionsGRPC_XDS_BOOTSTRAP
behaviour between grpc-go
versions
@davinci26 yeah the library now expect the bootstrap file to be present at the init time after the changes in #7898. It is because internally we have a way to set fallback bootstrap config but only if the env vars were not set https://github.com/grpc/grpc-go/blob/master/xds/internal/xdsclient/pool.go#L148 but its not exposed. It was done mainly because we wanted to disallow overriding. Our example recommend the bootstrap file to be present beforehand https://github.com/grpc/grpc-go/blob/master/examples/features/xds/README.md#the-client but since the previous versions allowed creating and setting the bootstrap file at runtime, I will ask other maintainers if we want to expose setting fallback config for backward compatibility. |
@purnesh42H totally fair, we are maybe in a hyrum law situation where you are a victim of your own success. This is a breaking change for us so we would happily take the escape hatch for back compatibility. We are excited to try out other features like So we can plan a bit internally:
|
Reading the bootstrap configuration is supposed to happen once during program init and the fact that whatever you are doing was working earlier is exactly a Hyrum's law situation. We are sorry for breaking you, but we don't have any plans of exposing the API to set fallback bootstrap configuration (that gets used when the environment variables are not set). In fact, all the APIs used by the xDS client are internal only APIs, and exposing anything from there would lock us in since we are planning to make some major changes there. Maybe, if we understand your deployment better, we might be able to suggest ways that you can use to get things to work with the existing functionality/behavior. Do you run in a containerized environment? If so, we do have a binary which can be run as an init container to generate bootstrap configuration and place it in a well known location for your program to pick up. Please see: https://github.com/GoogleCloudPlatform/traffic-director-grpc-bootstrap |
This is the alternative we are considering along with other
100% up to you as the maintainer team. I think the perspective is that having the ability for the program to configure the library is a nice feature and makes the UX much better. Because while the problem can be addressed with an Especially since So I guess the verdict is that we should solve this at the infrastructure layer? (I am ok with either outcome just wanted the clarity so we can plan internally next steps) |
I checked with other maintainers and looks like other gRPC languages don't read the bootstrap file pointed to by the environment variable at init time. Instead they do it lazily when the first xDS client is created (which is triggered either when the first xDS enabled channel or server is created). So, we will make the same change in grpc-go as well. Thanks for filing the issue and engaging in a useful conversation. |
I am not sure if this is considered a bug / breaking change or by design
Previous versions of
grpc-go
checked the existence ofXDSBootstrapFileNameEnv = "GRPC_XDS_BOOTSTRAP"
atinit()
but the latest version is creating the xds client pool atinit
. Which means that previously we could pass an env variable that points to a file and have the program itself construct the config.The snippet below shows the current behaviour
At
init()
we callbootstrap.GetConfiguration()
and then construct a pool that is invalid becauseconfig
is anil
.This is a breaking change because the program here https://gist.github.com/davinci26/4d4a9dcd1e5e7d7842037a438132e813 worked with
v.1.70
but does not work withv.1.71
On why we construct the
json
file in-process is mostly as a convenience factor so we can add thelocality
field based on the process information.The text was updated successfully, but these errors were encountered: