Chia-Ping Tsai created YUNIKORN-806:
---------------------------------------
Summary: Remove busy loop from PlaceholderManager#start
Key: YUNIKORN-806
URL: https://issues.apache.org/jira/browse/YUNIKORN-806
Project: Apache YuniKorn
Issue Type: Improvement
Reporter: Chia-Ping Tsai
The busy loop can be refactor by select timeout.
{code:go}
// clean orphan placeholders approximately every 5 seconds,
check for stop every 100 milliseconds
for {
mgr.cleanOrphanPlaceholders()
for i := 0; i < 50; i++ {
select {
case <-mgr.stopChan:
mgr.setRunning(false)
log.Logger().Info("PlaceholderManager
has been stopped")
return
default:
time.Sleep(100 * time.Millisecond)
}
}
}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]