Skip to content

Commit

Permalink
Bring in Mohan's change
Browse files Browse the repository at this point in the history
  • Loading branch information
zasweq committed Aug 15, 2023
1 parent 0fc2539 commit b8ac621
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions internal/envconfig/envconfig.go
Expand Up @@ -37,9 +37,8 @@ var (
// checking which NACKs configs specifying ring sizes > 8*1024*1024 (~8M).
RingHashCap = uint64FromEnv("GRPC_RING_HASH_CAP", 4096, 1, 8*1024*1024)
// PickFirstLBConfig is set if we should support configuration of the
// pick_first LB policy, which can be enabled by setting the environment
// variable "GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG" to "true".
PickFirstLBConfig = boolFromEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG", false)
// pick_first LB policy.
PickFirstLBConfig = boolFromEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG", true)
// LeastRequestLB is set if we should support the least_request_experimental
// LB policy, which can be enabled by setting the environment variable
// "GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST" to "true".
Expand Down
7 changes: 3 additions & 4 deletions xds/internal/xdsclient/xdslbregistry/xdslbregistry_test.go
Expand Up @@ -202,7 +202,7 @@ func (s) TestConvertToServiceConfigSuccess(t *testing.T) {
rhDisabled: true,
},
{
name: "pick_first_disabled_pf_rr_use_first_supported",
name: "pick_first_enabled_pf_rr_use_pick_first",
policy: &v3clusterpb.LoadBalancingPolicy{
Policies: []*v3clusterpb.LoadBalancingPolicy_Policy{
{
Expand All @@ -219,8 +219,7 @@ func (s) TestConvertToServiceConfigSuccess(t *testing.T) {
},
},
},
wantConfig: `[{"round_robin": {}}]`,
pfDisabled: true,
wantConfig: `[{"pick_first": { "shuffleAddressList": true }}]`,
},
{
name: "least_request_disabled_pf_rr_use_first_supported",
Expand Down Expand Up @@ -341,7 +340,7 @@ func (s) TestConvertToServiceConfigSuccess(t *testing.T) {
defer func(old bool) { envconfig.LeastRequestLB = old }(envconfig.LeastRequestLB)
envconfig.LeastRequestLB = false
}
if !test.pfDisabled {
if test.pfDisabled {
defer func(old bool) { envconfig.PickFirstLBConfig = old }(envconfig.PickFirstLBConfig)
envconfig.PickFirstLBConfig = false
}
Expand Down

0 comments on commit b8ac621

Please sign in to comment.