You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/01/07 03:37:32 UTC

[GitHub] [incubator-yunikorn-core] wilfred-s commented on pull request #230: [YUNIKORN-484] Added waiting state timeout

wilfred-s commented on pull request #230:
URL: https://github.com/apache/incubator-yunikorn-core/pull/230#issuecomment-755862069


   We can only ever have one state timer in an application there is no need for multiple state timers as an application can only be in one state at a time. The timer is an app instance variable so we always need to call using the app instance.
   
   The start call is always the same: `app.SetTimer(app.timeoutX, currentState, event)`. The start of the timer will always call the exact same method on the app. The `timeoutX` is directly linked to the app and the state it is in. The other 2 values are fixed per state.
   The generic callback that is set with the `time.AfterFunc` will also be the same for all states: `app.TimeoutTimer(currentState, event)`
   
   Leave state will always be the same call. Nothing special happens there: `app.ClearTimer()`
   That could be defined as a fsm callback on `leave_state` always just need to make sure it is nil safe etc.
   
   That is a simpler solution than having a map as all state related details are in the ApplicationState and the functions are totally generic defined in the app where they must be defined even for the map based setup.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org