Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kds): experimental watchdog concurrent map write #7630

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/kds/v2/server/event_based_watchdog.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
envoy_core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
"github.com/go-logr/logr"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/exp/maps"

"github.com/kumahq/kuma/pkg/core"
"github.com/kumahq/kuma/pkg/core/resources/model"
Expand Down Expand Up @@ -39,7 +40,7 @@ func (e *EventBasedWatchdog) Start(stop <-chan struct{}) {
defer fullResyncTicker.Stop()

// for the first reconcile assign all types
changedTypes := e.ProvidedTypes
changedTypes := maps.Clone(e.ProvidedTypes)

for {
select {
Expand All @@ -64,7 +65,7 @@ func (e *EventBasedWatchdog) Start(stop <-chan struct{}) {
}
case <-fullResyncTicker.C:
e.Log.V(1).Info("schedule full resync")
changedTypes = e.ProvidedTypes
changedTypes = maps.Clone(e.ProvidedTypes)
case event := <-e.Listener.Recv():
resChange, ok := event.(events.ResourceChangedEvent)
if !ok {
Expand Down