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: Scheduled rollout cause a data race #2309

Merged
merged 2 commits into from
Sep 2, 2024
Merged

fix: Scheduled rollout cause a data race #2309

merged 2 commits into from
Sep 2, 2024

Conversation

thomaspoignant
Copy link
Owner

Description

As reported in issue #2256, in some cases we can have a data race when using a scheduled rollout.

This PR fixes the issue by creating a deep copy of the flag before applying the scheduled steps.

Closes issue(s)

Resolve #2256

Checklist

  • I have tested this code
  • I have added unit test to cover this code
  • I have followed the contributing guide

Copy link

netlify bot commented Sep 2, 2024

Deploy Preview for go-feature-flag-doc-preview canceled.

Name Link
🔨 Latest commit 592dd1a
🔍 Latest deploy log https://app.netlify.com/sites/go-feature-flag-doc-preview/deploys/66d611378020b20008949c37

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.02%. Comparing base (5f0e47c) to head (592dd1a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/flag/internal_flag.go 95.45% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2309      +/-   ##
==========================================
- Coverage   86.03%   86.02%   -0.01%     
==========================================
  Files         102      102              
  Lines        3730     3743      +13     
==========================================
+ Hits         3209     3220      +11     
- Misses        398      399       +1     
- Partials      123      124       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarqubecloud bot commented Sep 2, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@thomaspoignant thomaspoignant merged commit 5388a5a into main Sep 2, 2024
21 of 22 checks passed
@thomaspoignant thomaspoignant deleted the fix-2256 branch September 2, 2024 19:32
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.

(bug) Panic on applyScheduledRolloutSteps
1 participant