Change:
PLEASE COORDINATE WITH SIG-SCHEDULING BEFORE WORKING ON THIS ISSUE. We want to avoid the situation where two people accidentally start work on the same fix. Main tracking issue: Currently, the feature is set up at the end of in . This setup should be moved into its own helper function, preferably in the package. /sig scheduling /kind cleanup /help
/assign /remove-help
I'd like to take this one
/remove-help
the PR I sent should resolve this one. :disappointed: Are any of the others still available?

Discussion:
srcs = [ "factory.go", "plugins.go", <del> "signal.go", "signal_windows.go", </del> ], importpath = "k8s.io/kubernetes/pkg/scheduler/factory", visibility = ["//visibility:public"],

import ( "fmt" <del> "os" "os/signal" </del> "reflect" "time"

}, ) <del> // Setup cache comparer </del> <ins> // Setup cache debugger </ins> debugger := cachedebugger.New( args.NodeInformer.Lister(), args.PodInformer.Lister(), c.schedulerCache, c.podQueue, ) <del> ch := make(chan os.Signal, 1) signal.Notify(ch, compareSignal) </del> <ins> debugger.ListenForSignal(c.StopEverything) </ins> go func() { <del> for { select { case <-c.StopEverything: c.podQueue.Close() return case <-ch: debugger.Comparer.Compare() debugger.Dumper.DumpAll() } } </del> <ins> <-c.StopEverything c.podQueue.Close() </ins> }() return c

<del> // +build !windows /* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package factory import "syscall" // compareSignal is the signal to trigger cache compare. For non-windows // environment it's SIGUSR2. var compareSignal = syscall.SIGUSR2 </del>

<del> /* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package factory import "os" // compareSignal is the signal to trigger cache compare. For windows, // it's SIGINT. var compareSignal = os.Interrupt </del>

"comparer.go", "debugger.go", "dumper.go", <ins> "signal.go", "signal_windows.go", </ins> ], importpath = "k8s.io/kubernetes/pkg/scheduler/internal/cache/debugger", visibility = ["//pkg/scheduler:__subpackages__"],

package debugger import ( <ins> "os" "os/signal" </ins> corelisters "k8s.io/client-go/listers/core/v1" internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache" internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"

}, } } <ins> // ListenForSignal starts a goroutine that will trigger the CacheDebugger's // behavior when the process receives SIGINT (Windows) or SIGUSER2 (non-Windows). func (d *CacheDebugger) ListenForSignal(stopCh <-chan struct{}) { ch := make(chan os.Signal, 1) signal.Notify(ch, compareSignal) go func() { for { select { case <-stopCh: return case <-ch: d.Comparer.Compare() d.Dumper.DumpAll() } } }() } </ins>

<ins> // +build !windows /* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package debugger import "syscall" // compareSignal is the signal to trigger cache compare. For non-windows // environment it's SIGUSR2. var compareSignal = syscall.SIGUSR2 </ins>

<ins> /* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package debugger import "os" // compareSignal is the signal to trigger cache compare. For windows, // it's SIGINT. var compareSignal = os.Interrupt </ins>