Dale Richardson created YUNIKORN-3368:
-----------------------------------------
Summary: KubernetesShim.Stop() after a failed Run() is a no-op,
leaking the dispatcher and placeholder-manager goroutines
Key: YUNIKORN-3368
URL: https://issues.apache.org/jira/browse/YUNIKORN-3368
Project: Apache YuniKorn
Issue Type: Bug
Components: shim - kubernetes
Reporter: Dale Richardson
Follow-up to YUNIKORN-3357 (PR #1061); burns down the leakcheck exemptions
cache.(*PlaceholderManager).Start.func1 and dispatcher.Start.func1.
{{KubernetesShim.Stop()}} only stops the placeholder manager and dispatcher
from inside the {{{}case ss.stopChan <- struct{}{{}}}} arm of a select that has
a {{default:}} branch. When {{Run()}} fails before {{doScheduling()}} starts,
nothing is receiving on {{{}stopChan{}}}, so {{Stop()}} takes the default
branch, logs "scheduler is already stopped" and returns having stopped neither
component. {{Run()}} calls {{Stop()}} itself on registration or
state-initialization failure, so the shim leaks both goroutines on every failed
startup.
Repro: {{{}go test ./pkg/shim -run TestSchedulerRegistrationFailed{}}}. (In a
full-package run the dispatcher goroutine is masked because it is a package
singleton a later test stops; it leaks when that test runs alone.)
Proposed fix: {{Stop()}} must release what it owns regardless of how far
{{Run()}} progressed, then delete both exemptions. Shares the
{{{}Stop(){}}}/{{{}stopChan{}}} select with the doScheduling finding above.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]