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

bgpv1: Avoid creating resource.Store in Start() hive hooks of BGP CP #29954

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

rastislavs
Copy link
Contributor

@rastislavs rastislavs commented Dec 18, 2023

This PR ensures that resource.Store is not created in Start() hive hooks of the BGP CP. The motivation is:

Please also see commit messages for some more details.

Fixes: #29371

bgpv1: Avoid creating `resource.Store` in `Start()` hive hooks of BGP CP to ensure proper BGP CP initialization.

This changes BGP Controller's event handling from hive hooks
and workerpool to hive jobs, mainly to avoid creating resource.Store
in the Start() hive hook of the BGP controller.

Since creating resource.Store() blocks until the store is initialized,
we should avoid calling it in the Start() hive hook to not
slow down the startup process and to allow progressing with the
startup even when the CRD is not yet installed.

Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
This changes event handling in BGP CP resource.Store wrappers
(DiffStore, BGPCPResourceStore) from hive hooks and a goroutine
to a hive job, mainly to avoid creating resource.Store in the
Start() hive hook.

This also makes them wrappers rather than a super set of the
resource.Store, exposing only API that is actually used within
the BGP CP, and allowing all methods to return an error if the store
has not yet initialized.

Since creating resource.Store() blocks until the store is initialized,
we should avoid calling it in the Start() hive hook to not
slow down the startup process and to allow progressing with the
startup even when the CRD is not yet installed.

Signed-off-by: Rastislav Szabo <rastislav.szabo@isovalent.com>
@maintainer-s-little-helper 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 Dec 18, 2023
@rastislavs rastislavs added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Dec 18, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Dec 18, 2023
@rastislavs rastislavs added area/bgp kind/bug This is a bug in the Cilium logic. labels Dec 18, 2023
@rastislavs
Copy link
Contributor Author

/test

@rastislavs rastislavs marked this pull request as ready for review December 18, 2023 10:12
@rastislavs rastislavs requested a review from a team as a code owner December 18, 2023 10:12
Copy link
Contributor

@harsimran-pabla harsimran-pabla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think we should be setting appropriate heath report on store initialization failures, since such failures are not going to stop agent from starting up.

pkg/bgpv1/agent/controller.go Show resolved Hide resolved
pkg/bgpv1/manager/store/diffstore.go Show resolved Hide resolved
@maintainer-s-little-helper 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 Dec 19, 2023
@julianwiedmann
Copy link
Member

👋 is this fix worth backporting?

@julianwiedmann julianwiedmann added this pull request to the merge queue Dec 19, 2023
@rastislavs rastislavs added the needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch label Dec 19, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in v1.15.0-rc.1 Dec 19, 2023
@rastislavs
Copy link
Contributor Author

👋 is this fix worth backporting?

yeah, would be worth to backport at least to 1.15 - added the label

Merged via the queue into cilium:main with commit 08017c2 Dec 19, 2023
63 checks passed
@pippolo84 pippolo84 mentioned this pull request Jan 2, 2024
17 tasks
@pippolo84 pippolo84 added backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Jan 2, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.15 in v1.15.0-rc.1 Jan 2, 2024
@aanm aanm added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. and removed backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. labels Jan 16, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.15 to Backport done to v1.15 in v1.15.0-rc.1 Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bgp backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
v1.15.0-rc.1
Backport done to v1.15
Development

Successfully merging this pull request may close these issues.

Cilium Helm install does not finish properly when BGP CP is enabled.
5 participants