From 6754999188e517ad37ea01665377bfb9c648885e 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/endpoint_slice.go | 1 - pkg/agent/controller/service_import.go | 1 - pkg/agent/controller/types.go | 3 --- 3 files changed, 5 deletions(-) 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 ce639e708..2f1f11768 100644 --- a/pkg/agent/controller/service_import.go +++ b/pkg/agent/controller/service_import.go @@ -99,7 +99,6 @@ func newServiceImportController(spec *AgentSpecification, syncerMetricNames Agen Transform: controller.onRemoteServiceImport, OnSuccessfulSync: controller.serviceImportMigrator.onSuccessfulSyncFromBroker, Scheme: syncerConfig.Scheme, - ResyncPeriod: BrokerResyncPeriod, NamespaceInformer: syncerConfig.NamespaceInformer, SyncCounterOpts: &prometheus.GaugeOpts{ Name: syncerMetricNames.ServiceImportCounterName, diff --git a/pkg/agent/controller/types.go b/pkg/agent/controller/types.go index 9e2611440..fe054b7b7 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" @@ -42,8 +41,6 @@ const ( portConflictReason = "ConflictingPorts" ) -var BrokerResyncPeriod = time.Minute * 2 - type EndpointSliceListerFn func(selector k8slabels.Selector) []runtime.Object type converter struct {