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 remote cluster sync timeout issue #42252

Merged

Conversation

SpecialYang
Copy link
Member

Currently, the informerInit marker doesn't work for remote cluster sync timeout case. Remove it and use the initialSync marker.

CC @hzxuzhonghu

@SpecialYang SpecialYang requested a review from a team as a code owner December 3, 2022 03:02
@istio-policy-bot
Copy link

🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test?

Courtesy of your friendly test nag.

@istio-testing istio-testing added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 3, 2022
@SpecialYang SpecialYang added the release-notes-none Indicates a PR that does not require release notes. label Dec 3, 2022
@hzxuzhonghu
Copy link
Member

the informerInit marker doesn't work for remote cluster sync timeout case

Can you elaborate on this

@SpecialYang
Copy link
Member Author

The HasSync method only cares about the var initialSync. The var informerInit doesn't effect on the logic of HasSync. Additionally, we alway set the informerInit as true before execution of WaitForCacheSync. So this var is useless and doesn't work for the cluster sync timeout case.

func (c *Controller) Run(stop <-chan struct{}) {
if c.opts.SyncTimeout != 0 {
time.AfterFunc(c.opts.SyncTimeout, func() {
if !c.informerInit.Load() {
log.Warnf("kube controller for %s initial sync timed out", c.opts.ClusterID)
c.informerInit.Store(true)
}
})
}
st := time.Now()
if c.opts.NetworksWatcher != nil {
c.opts.NetworksWatcher.AddNetworksHandler(c.reloadNetworkLookup)
c.reloadMeshNetworks()
c.reloadNetworkGateways()
}
c.informerInit.Store(true)
kubelib.WaitForCacheSync(stop, c.informersSynced)

Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

Can you add a release note, it need to be backported

@SpecialYang SpecialYang requested review from a team as code owners December 5, 2022 06:03
@SpecialYang SpecialYang removed the release-notes-none Indicates a PR that does not require release notes. label Dec 5, 2022
@SpecialYang SpecialYang force-pushed the fix-remote-cluster-sync-timeout branch from f4c4e21 to 2450c85 Compare December 5, 2022 06:05
@SpecialYang SpecialYang force-pushed the fix-remote-cluster-sync-timeout branch from 2450c85 to 5aabdfd Compare December 5, 2022 06:06
@SpecialYang
Copy link
Member Author

/retest

1 similar comment
@SpecialYang
Copy link
Member Author

/retest

Copy link
Contributor

@ericvn ericvn left a comment

Choose a reason for hiding this comment

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

Release Notes LGTM

@SpecialYang
Copy link
Member Author

/retest

@istio-testing istio-testing merged commit 497fbab into istio:master Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants