Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork150
fix: data race onSystray.SetCurrentConfigFile
#1012
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…OME and HOME directories
codecov-commenter commentedJan 21, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #1012 +/- ##==========================================+ Coverage 20.14% 21.59% +1.44%========================================== Files 42 42 Lines 3222 3228 +6 ==========================================+ Hits 649 697 +48+ Misses 2488 2442 -46- Partials 85 89 +4
Flags with carried forward coverage won't be shown.Click here to find out more. ☔ View full report in Codecov by Sentry. |
…e testing that branch
… non-existing config path
Systray.SetCurrentConfigFile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I am not sure which is the difference theconfigPath
is still accessed concurrently by the main thread and in the loop.
if configPath == nil { | ||
log.Panic("configPath is nil") | ||
} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
configPath
should always be not nil, can we avoid the check?
Uh oh!
There was an error while loading.Please reload this page.
Please check if the PR fulfills these requirements
before creating one)
Fix a data race on the config set to the Systray struct.
When the agent starts, there is a data race on the
SetCurrentConfigFile
method called by two different go routines.The config is read in the main and the
SetCurrentConfigFile
on Systray is called by the main goroutine (and not in the otherloop
go routine)legacy
behaviours is not easy (the config.ini file in the old location is copied into the new home location). It relies on theos.Executable()
calls