Skip to content

Commit 39ae0b2

Browse files
committed
Changed Outlier Detection Env Var to default true
1 parent 36e4810 commit 39ae0b2

File tree

6 files changed

+5
-36
lines changed

6 files changed

+5
-36
lines changed

internal/envconfig/xds.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ var (
8484
// "GRPC_XDS_EXPERIMENTAL_RBAC" to "false".
8585
XDSRBAC = !strings.EqualFold(os.Getenv(rbacSupportEnv), "false")
8686
// XDSOutlierDetection indicates whether outlier detection support is
87-
// enabled, which can be enabled by setting the environment variable
88-
// "GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION" to "true".
89-
XDSOutlierDetection = strings.EqualFold(os.Getenv(outlierDetectionSupportEnv), "true")
87+
// enabled, which can be disabled by setting the environment variable
88+
// "GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION" to "false".
89+
XDSOutlierDetection = !strings.EqualFold(os.Getenv(outlierDetectionSupportEnv), "false")
9090
// XDSFederation indicates whether federation support is enabled.
9191
XDSFederation = strings.EqualFold(os.Getenv(federationEnv), "true")
9292

test/xds/xds_client_outlier_detection_test.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"google.golang.org/grpc"
3434
"google.golang.org/grpc/credentials/insecure"
3535
"google.golang.org/grpc/internal"
36-
"google.golang.org/grpc/internal/envconfig"
3736
"google.golang.org/grpc/internal/stubserver"
3837
"google.golang.org/grpc/internal/testutils/xds/e2e"
3938
testgrpc "google.golang.org/grpc/test/grpc_testing"
@@ -49,13 +48,8 @@ import (
4948
// Detection balancer. This test verifies that an RPC is able to proceed
5049
// normally with this configuration.
5150
func (s) TestOutlierDetection_NoopConfig(t *testing.T) {
52-
oldOD := envconfig.XDSOutlierDetection
53-
envconfig.XDSOutlierDetection = true
5451
internal.RegisterOutlierDetectionBalancerForTesting()
55-
defer func() {
56-
envconfig.XDSOutlierDetection = oldOD
57-
internal.UnregisterOutlierDetectionBalancerForTesting()
58-
}()
52+
defer internal.UnregisterOutlierDetectionBalancerForTesting()
5953

6054
managementServer, nodeID, _, resolver, cleanup1 := e2e.SetupManagementServer(t, nil)
6155
defer cleanup1()
@@ -129,13 +123,8 @@ func clusterWithOutlierDetection(clusterName, edsServiceName string, secLevel e2
129123
// Detection Balancer should eject the connection to the backend which
130124
// constantly errors, and thus RPC's should mainly go to backend 1 and 2.
131125
func (s) TestOutlierDetectionWithOutlier(t *testing.T) {
132-
oldOD := envconfig.XDSOutlierDetection
133-
envconfig.XDSOutlierDetection = true
134126
internal.RegisterOutlierDetectionBalancerForTesting()
135-
defer func() {
136-
envconfig.XDSOutlierDetection = oldOD
137-
internal.UnregisterOutlierDetectionBalancerForTesting()
138-
}()
127+
defer internal.UnregisterOutlierDetectionBalancerForTesting()
139128

140129
managementServer, nodeID, _, resolver, cleanup := e2e.SetupManagementServer(t, nil)
141130
defer cleanup()

xds/internal/balancer/cdsbalancer/cdsbalancer_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"google.golang.org/grpc/balancer"
3030
"google.golang.org/grpc/connectivity"
3131
"google.golang.org/grpc/internal"
32-
"google.golang.org/grpc/internal/envconfig"
3332
"google.golang.org/grpc/internal/grpctest"
3433
internalserviceconfig "google.golang.org/grpc/internal/serviceconfig"
3534
"google.golang.org/grpc/internal/testutils"
@@ -366,14 +365,11 @@ func (s) TestUpdateClientConnStateWithSameState(t *testing.T) {
366365
// different updates and verifies that the expect ClientConnState is propagated
367366
// to the edsBalancer.
368367
func (s) TestHandleClusterUpdate(t *testing.T) {
369-
oldOutlierDetection := envconfig.XDSOutlierDetection
370-
envconfig.XDSOutlierDetection = true
371368
xdsC, cdsB, edsB, _, cancel := setupWithWatch(t)
372369
xdsC.SetBootstrapConfig(&bootstrap.Config{
373370
XDSServer: defaultTestAuthorityServerConfig,
374371
})
375372
defer func() {
376-
envconfig.XDSOutlierDetection = oldOutlierDetection
377373
cancel()
378374
cdsB.Close()
379375
}()

xds/internal/balancer/clusterresolver/clusterresolver_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"google.golang.org/grpc/balancer/weightedtarget"
3232
"google.golang.org/grpc/connectivity"
3333
"google.golang.org/grpc/internal"
34-
"google.golang.org/grpc/internal/envconfig"
3534
"google.golang.org/grpc/internal/grpctest"
3635
internalserviceconfig "google.golang.org/grpc/internal/serviceconfig"
3736
"google.golang.org/grpc/internal/testutils"
@@ -533,12 +532,7 @@ func newLBConfigWithOneEDSAndOutlierDetection(edsServiceName string, odCfg outli
533532
// Configuration sent downward should have a top level Outlier Detection Policy
534533
// for each priority.
535534
func (s) TestOutlierDetection(t *testing.T) {
536-
oldOutlierDetection := envconfig.XDSOutlierDetection
537-
envconfig.XDSOutlierDetection = true
538535
internal.RegisterOutlierDetectionBalancerForTesting()
539-
defer func() {
540-
envconfig.XDSOutlierDetection = oldOutlierDetection
541-
}()
542536

543537
edsLBCh := testutils.NewChannel()
544538
xdsC, cleanup := setup(edsLBCh)

xds/internal/balancer/clusterresolver/configbuilder_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"google.golang.org/grpc/balancer/roundrobin"
3232
"google.golang.org/grpc/balancer/weightedroundrobin"
3333
"google.golang.org/grpc/balancer/weightedtarget"
34-
"google.golang.org/grpc/internal/envconfig"
3534
"google.golang.org/grpc/internal/hierarchy"
3635
internalserviceconfig "google.golang.org/grpc/internal/serviceconfig"
3736
"google.golang.org/grpc/resolver"
@@ -323,12 +322,6 @@ func TestBuildPriorityConfig(t *testing.T) {
323322
// priority should be an Outlier Detection balancer, with a Cluster Impl
324323
// Balancer as a child.
325324
func TestBuildPriorityConfigWithOutlierDetection(t *testing.T) {
326-
oldOutlierDetection := envconfig.XDSOutlierDetection
327-
envconfig.XDSOutlierDetection = true
328-
defer func() {
329-
envconfig.XDSOutlierDetection = oldOutlierDetection
330-
}()
331-
332325
gotConfig, _, _ := buildPriorityConfig([]priorityConfig{
333326
{
334327
// EDS - OD config should be the top level for both of the EDS

xds/internal/xdsclient/xdsresource/unmarshal_cds_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,9 +1690,6 @@ func (s) TestUnmarshalCluster(t *testing.T) {
16901690
}
16911691

16921692
func (s) TestValidateClusterWithOutlierDetection(t *testing.T) {
1693-
oldOutlierDetectionSupportEnv := envconfig.XDSOutlierDetection
1694-
envconfig.XDSOutlierDetection = true
1695-
defer func() { envconfig.XDSOutlierDetection = oldOutlierDetectionSupportEnv }()
16961693
odToClusterProto := func(od *v3clusterpb.OutlierDetection) *v3clusterpb.Cluster {
16971694
// Cluster parsing doesn't fail with respect to fields orthogonal to
16981695
// outlier detection.

0 commit comments

Comments
 (0)