[ 
https://issues.apache.org/jira/browse/YUNIKORN-806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chia-Ping Tsai updated YUNIKORN-806:
------------------------------------
    Summary: Refactor busy loop of PlaceholderManager#start  (was: Remove busy 
loop from PlaceholderManager#start)

> 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
>
> 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: issues-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to