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

Multiple informers for the same resource(NodeResourceTopologies) may be serving at the same time #656

Closed
1 of 4 tasks
NoicFank opened this issue Nov 2, 2023 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@NoicFank
Copy link
Contributor

NoicFank commented Nov 2, 2023

Area

  • Scheduler
  • Controller
  • Helm Chart
  • Documents

Other components

No response

What happened?

Why could this happen?

Once we configure plugin NodeResourceTopologyMatch in multi profiles(must more than one), then informers about NodeResourceTopologies may start multi times with different ShardInformerFactory.

Since informer about NodeResourceTopologies is created within this plugin's func New() here as following:

func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error) {
	...
	nrtCache, err := initNodeTopologyInformer(tcfg, handle)
	...

And, informer about NodeResourceTopologies created from the brandNew Factory within func initNodeTopologyInformer here, as following:

func initNodeTopologyInformer(tcfg *apiconfig.NodeResourceTopologyMatchArgs, handle framework.Handle) (nrtcache.Interface, error) {
	...
	topologyInformerFactory := topologyinformers.NewSharedInformerFactory(topoClient, 0)
	nodeTopologyInformer := topologyInformerFactory.Topology().V1alpha2().NodeResourceTopologies()
	nodeTopologyLister := nodeTopologyInformer.Lister()
        ...
}

Then, When we create scheduler profile one bye one, The func New() would be called many times, since plugin NodeResourceTopologyMatch exists in multiple profiles. Then multiple informers about NodeResourceTopologies will be produced.

What are the negative effects?

  • Data inconsistencies among those informers, even if the time difference is small.
  • Waste of local storage: as multiple same indexer with the same content will exist

What did you expect to happen?

How to prevent it?

Creating NewSharedInformerFactory When we create Scheduler instead of creating plugins. And we pass the created Informers about CRD from NewSharedInformerFactory to those needed plugins while it started.

How can we reproduce it (as minimally and precisely as possible)?

No response

Anything else we need to know?

@Huang-Wei Please see if this issue makes sense, thanks.

Kubernetes version

$ kubectl version
# paste output here

Scheduler Plugins version

@NoicFank NoicFank added the kind/bug Categorizes issue or PR as related to a bug. label Nov 2, 2023
@NoicFank
Copy link
Contributor Author

NoicFank commented Nov 2, 2023

This is a rough implementation to better state the solution. #657

@Huang-Wei PTAL, thanks.

@Huang-Wei
Copy link
Contributor

Please see if this issue makes sense, thanks.

Yes, the issue is generic for plugins that are registered in multiple profiles but want to instantiate particular informers once in New().

@NoicFank
Copy link
Contributor Author

NoicFank commented Nov 3, 2023

Please see if this issue makes sense, thanks.

Yes, the issue is generic for plugins that are registered in multiple profiles but want to instantiate particular informers once in New().

Thank you for your speedy reply!

It's always a pleasure to ask you questions.

@NoicFank
Copy link
Contributor Author

NoicFank commented Nov 6, 2023

PR #655 will fix this.

details:
#657 (comment)

@NoicFank
Copy link
Contributor Author

NoicFank commented Nov 6, 2023

/close

@k8s-ci-robot
Copy link
Contributor

@NoicFank: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants