-
Notifications
You must be signed in to change notification settings - Fork 143
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
Avoid data race by calling forceCompState only on commandRuntime.Run #3537
Avoid data race by calling forceCompState only on commandRuntime.Run #3537
Conversation
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
Instead of using the component state to show the error, log it using the component stderr logger
8e330cb
to
7a08cb1
Compare
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.
Looks good.
kind: bug | ||
|
||
# Change summary; a 80ish characters long description of the change. | ||
summary: Avoid possible data race when diring a component start the Elastic Agent fails to write to the component's stdin |
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.
Do we need a changelog entry? Has this actually ever effected a user in a meaningful way?
🌐 Coverage report
|
buildkite test this |
1 similar comment
buildkite test this |
SonarQube Quality Gate |
…ime.Run (#3537) (#3555) Instead of startWatcher setting the component state on comm.WriteConnInfo failure, now it logs the error using the component stderr logger. (cherry picked from commit 39f324f) Co-authored-by: Anderson Queiroz <[email protected]>
What does this PR do?
Instead of using the component state to show the error, log it using the component stderr logger
Why is it important?
If
forceCompState
is called outside(*commandRuntime).Run
it creates a data race.Checklist
[ ] I have commented my code, particularly in hard-to-understand areas[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature works[ ] I have added an entry in./changelog/fragments
using the changelog tool[ ] I have added an integration test or an E2E testRelated issues
Questions to ask yourself