[CONTP-1961] Fix metadata cluster UID initialization race - #3334
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
tbavelier
force-pushed
the
tbavelier/operator-go-race
branch
from
August 6, 2026 12:36
2423415 to
c98751d
Compare
tbavelier
marked this pull request as ready for review
August 6, 2026 12:40
gabedos
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Synchronize lazy initialization of the shared Kubernetes cluster UID used by metadata forwarder workers.
Why
Concurrent CRD metadata-forwarder workers could read and write
SharedMetadata.clusterUIDat the same time, producing a Go race-detector report. https://ddstaging.datadoghq.com/logs?query=host%3Aip-10-128-196-132.ec2.internal-entei%20service%3Adatadog-operator%20container_id%3A199e4361cedff4abef54b07dda6c072671c2464f7d71ba5abd25f8f53ec328e4%20filename%3A0.log&agg_m=count&agg_m_source=base&agg_t=count&cols=host%2Cservice&context_event=AZ_XB9KJAAAs6yuutNwo6AA5&fromUser=true&messageDisplay=inline&refresh_mode=paused&storage=hot&stream_sort=time%2Cdesc&to_event=AwAAAZ_XB8hXSvP2XQAAABhBWl9YQjlLSkFBQXM2eXV1dE53bzZBQkQAAAAkMDE5ZmQ3MGMtMzE5ZS00YTE5LTgxOWYtNWUyZTM4MDUwYTkyAAAO1A&viz=stream&from_ts=1786018739317&to_ts=1786019039320&live=falseValidation
go test -race ./pkg/controller/utils/metadata