From 954d6fd4385687bcdf446c5a647f0f636c4a9d82 Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Thu, 22 Aug 2024 10:22:34 -0400 Subject: [PATCH] Remove broker resync period for ServiceImport and EndpointSlices This has proven to be problematic at larger scale, significantly increasing latencies due to the rate limiting. It was put in to easily handle a hypothetical, unlikely edge case where a service namespace is deleted then recreated but the potential performance hit to handle it in this manner isn't worth it. Now that the resource syncer can watch namespaces, we can handle it there. Fixes https://github.com/submariner-io/lighthouse/issues/1623 Signed-off-by: Tom Pantelis --- pkg/agent/controller/controller_suite_test.go | 2 -- pkg/agent/controller/endpoint_slice.go | 1 - pkg/agent/controller/service_import.go | 1 - pkg/agent/controller/types.go | 3 --- 4 files changed, 7 deletions(-) diff --git a/pkg/agent/controller/controller_suite_test.go b/pkg/agent/controller/controller_suite_test.go index 844b6d6e1..8d261e193 100644 --- a/pkg/agent/controller/controller_suite_test.go +++ b/pkg/agent/controller/controller_suite_test.go @@ -109,8 +109,6 @@ func init() { if err != nil { panic(err) } - - controller.BrokerResyncPeriod = time.Millisecond * 100 } func TestController(t *testing.T) { diff --git a/pkg/agent/controller/endpoint_slice.go b/pkg/agent/controller/endpoint_slice.go index d7374b6c2..6d7f24338 100644 --- a/pkg/agent/controller/endpoint_slice.go +++ b/pkg/agent/controller/endpoint_slice.go @@ -70,7 +70,6 @@ func newEndpointSliceController(spec *AgentSpecification, syncerConfig broker.Sy c.enqueueForConflictCheck(context.TODO(), obj.(*discovery.EndpointSlice), op) return false }, - BrokerResyncPeriod: BrokerResyncPeriod, }, } diff --git a/pkg/agent/controller/service_import.go b/pkg/agent/controller/service_import.go index 1293486e6..5af7fdbb7 100644 --- a/pkg/agent/controller/service_import.go +++ b/pkg/agent/controller/service_import.go @@ -98,7 +98,6 @@ func newServiceImportController(spec *AgentSpecification, syncerMetricNames Agen Transform: controller.onRemoteServiceImport, OnSuccessfulSync: controller.serviceImportMigrator.onSuccessfulSyncFromBroker, Scheme: syncerConfig.Scheme, - ResyncPeriod: BrokerResyncPeriod, SyncCounterOpts: &prometheus.GaugeOpts{ Name: syncerMetricNames.ServiceImportCounterName, Help: "Count of imported services", diff --git a/pkg/agent/controller/types.go b/pkg/agent/controller/types.go index acd242aa5..e87ebcb58 100644 --- a/pkg/agent/controller/types.go +++ b/pkg/agent/controller/types.go @@ -20,7 +20,6 @@ package controller import ( "sync" - "time" "github.com/submariner-io/admiral/pkg/federate" "github.com/submariner-io/admiral/pkg/syncer" @@ -40,8 +39,6 @@ const ( portConflictReason = "ConflictingPorts" ) -var BrokerResyncPeriod = time.Minute * 2 - type EndpointSliceListerFn func(selector k8slabels.Selector) []runtime.Object type converter struct {