[
https://issues.apache.org/jira/browse/YUNIKORN-806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17401810#comment-17401810
]
Weiwei Yang commented on YUNIKORN-806:
--------------------------------------
hi [~chia7712] thanks for working on this.
[~tingyao] can you help to review this JIRA? thanks
> Refactor busy loop of PlaceholderManager#start
> ----------------------------------------------
>
> Key: YUNIKORN-806
> URL: https://issues.apache.org/jira/browse/YUNIKORN-806
> Project: Apache YuniKorn
> Issue Type: Improvement
> Reporter: Chia-Ping Tsai
> Assignee: Chia-Ping Tsai
> Priority: Trivial
> Labels: pull-request-available
>
> 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]