Skip to content

Bug: Is there any risks that more than one NewPodTopologyCache running in one Scheduler App? #53

Description

@NoicFank

Func NewPodTopologyCache responses to build a common cache for plugin NodeResourceTopologyMatch, and it will be called in plugin's New func as following:

func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error) {
	...
	topologyMatch := &TopologyMatch{
                // here initializing the cache
		PodTopologyCache:       NewPodTopologyCache(ctx, 30*time.Minute),
		handle:                 handle,
		lister:                 lister,
		topologyAwareResources: sets.NewString(cfg.TopologyAwareResources...),
	}

	return topologyMatch, nil
}

Then, once plugin NodeResourceTopologyMatch appears in multi profiles for one scheduler app, then the plugin will be initialized many times, which means the upper func New will be triggered more than once.

Then, the most important thing is multi PodTopologyCache shows in one scheduler app. Is there any potential risks in this situation(e.g. data race)?

@Garrybest @qmhu PTAL, thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions