[interop] Fix crash in pick_first LB policy (#33519)

Fixes http://b/288420022
pull/33534/head
Eugene Ostroukhov 1 year ago committed by GitHub
parent 20fbd3fb30
commit fc4736c1ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      test/cpp/interop/rpc_behavior_lb_policy.cc

@ -86,6 +86,14 @@ class RpcBehaviorLbPolicy : public LoadBalancingPolicy {
absl::Status UpdateLocked(UpdateArgs args) override {
RefCountedPtr<RpcBehaviorLbPolicyConfig> config = std::move(args.config);
rpc_behavior_ = std::string(config->rpc_behavior());
// Use correct config for the delegate load balancing policy
auto delegate_config =
CoreConfiguration::Get().lb_policy_registry().ParseLoadBalancingConfig(
grpc_core::Json::FromArray({grpc_core::Json::FromObject(
{{std::string(delegate_->name()),
grpc_core::Json::FromObject({})}})}));
GPR_ASSERT(delegate_config.ok());
args.config = std::move(*delegate_config);
return delegate_->UpdateLocked(std::move(args));
}

Loading…
Cancel
Save