Skip to content

fix (internal/civisibility): Fix features load race condition#3501

Merged
tonyredondo merged 2 commits into
mainfrom
tony/civisibility-fix-features-load-race-condition
May 7, 2025
Merged

fix (internal/civisibility): Fix features load race condition#3501
tonyredondo merged 2 commits into
mainfrom
tony/civisibility-fix-features-load-race-condition

Conversation

@tonyredondo

@tonyredondo tonyredondo commented May 7, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Fix a race condition produced by modifying the ciVisibilitySettings instance from a goroutine while reading in the main thread.

The fix refactor the code to only write in the ciVisibilitySettings instance from settingsInitializationOnce other goroutines only read the settings. Also, ciVisibilitySettings is set only at the end of settingsInitializationOnce func.

Motivation

fix #3500

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running golangci-lint run locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@tonyredondo
tonyredondo marked this pull request as ready for review May 7, 2025 10:12
@tonyredondo
tonyredondo requested review from a team as code owners May 7, 2025 10:12
@tonyredondo
tonyredondo requested a review from gnufede May 7, 2025 10:12
@tonyredondo tonyredondo self-assigned this May 7, 2025
@pr-commenter

pr-commenter Bot commented May 7, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-05-07 10:38:25

Comparing candidate commit 5cd6368 in PR branch tony/civisibility-fix-features-load-race-condition with baseline commit 8495076 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 0 unstable metrics.

@tonyredondo
tonyredondo merged commit 8291ba3 into main May 7, 2025
@tonyredondo
tonyredondo deleted the tony/civisibility-fix-features-load-race-condition branch May 7, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data race in CI visibility and orchestrion

4 participants