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 data race during Hubble setup #28322
Merged
Merged
Conversation
This file contains 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
This commit fixes a data race where the setup of the hubbleObserver is being initialized in a new goroutine while the StatusCollector already tries to check Hubble's status. We fix the data race by switching to an atomic pointer to access the `hubbleObserver` in the Daemon struct. Fixing the data race by simply waiting to start the status collector until hubble is initialized does not work, as `launchHubble` could take up to 30s to return while waiting for a TLS certificate and we don't want to block agent startup for this. Fixes: cilium#28291 Signed-off-by: Fabian Fischer <fabian.fischer@isovalent.com>
maintainer-s-little-helper
bot
added
the
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
label
Sep 28, 2023
github-actions
bot
added
the
kind/community-contribution
This was a contribution made by a community member.
label
Sep 28, 2023
glrf
changed the title
Fix data race during Hubble setup in the daemon
Fix data race during Hubble setup
Sep 28, 2023
giorio94
approved these changes
Sep 28, 2023
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.
Overall looks good to me. Just one comment inline about a behavioral difference introduced in the refactoring.
giorio94
added
kind/cleanup
This includes no functional changes.
release-note/misc
This PR makes changes that have no direct user impact.
sig/hubble
Impacts hubble server or relay
labels
Sep 28, 2023
maintainer-s-little-helper
bot
removed
dont-merge/needs-release-note-label
The author needs to describe the release impact of these changes.
labels
Sep 28, 2023
kaworu
approved these changes
Oct 2, 2023
gandro
approved these changes
Oct 2, 2023
rolinh
approved these changes
Oct 3, 2023
maintainer-s-little-helper
bot
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Oct 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind/cleanup
This includes no functional changes.
kind/community-contribution
This was a contribution made by a community member.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/misc
This PR makes changes that have no direct user impact.
sig/hubble
Impacts hubble server or relay
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.
Please ensure your pull request adheres to the following guidelines:
description and a
Fixes: #XXX
line if the commit addresses a particularGitHub issue.
Fixes: <commit-id>
tag, thenplease add the commit author[s] as reviewer[s] to this issue.
This commit fixes a data race where the hubbleObserver is being initialized in a new goroutine while the StatusCollector already tries to check Hubble's status.
We fix the data race by switching to an atomic pointer to access the
hubbleObserver
in the Daemon struct.Fixing the data race by simply waiting to start the status collector until hubble is initialized does not work, as
launchHubble
could take up to 30s to return while waiting for a TLS certificate and we don't want to block agent startup for this.Fixes: #28291