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
Func
NewPodTopologyCacheresponses to build a common cache for pluginNodeResourceTopologyMatch, and it will be called in plugin's New func as following:Then, once plugin
NodeResourceTopologyMatchappears inmulti profilesfor one scheduler app, then the plugin will be initialized many times, which means the upper funcNewwill 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