andyhuangdev opened a new pull request, #1074: URL: https://github.com/apache/yunikorn-k8shim/pull/1074
### Description Fix KubernetesShim.Stop() to close its shared stop channel exactly once. Previously, Stop() sent one value to an unbuffered channel shared by two scheduling loops. Only one loop stopped, while the other could continue scheduling after the shim was stopped. Also, if Run() failed before the scheduling loops started, no receiver was present and Stop() skipped dispatcher and placeholder-manager cleanup. This change uses sync.Once to make shutdown idempotent, closes the channel to stop both scheduling loops, and always releases dispatcher and placeholder-manager resources during failed startup cleanup. ### Jira issues - https://issues.apache.org/jira/browse/YUNIKORN-3367 - https://issues.apache.org/jira/browse/YUNIKORN-3368 ### Testing - Added unit tests for closing the scheduler stop channel after a failed Run(). - Added a unit test confirming Stop() closes the channel and is safe to call repeatedly. - go test ./pkg/shim -run 'TestScheduler(RegistrationFailed|StopClosesStopChannel)$' -count=1 - go test ./pkg/shim -count=1 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
