[
https://issues.apache.org/jira/browse/YUNIKORN-2423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17819895#comment-17819895
]
Wilfred Spiegelenburg commented on YUNIKORN-2423:
-------------------------------------------------
This is left over work from YUNIKORN-2209.
However YUNIKORN-2030 was caught because we had an error returned by the queue
when we updated usage. There is also work ongoing at the K8s level that allows
changing the size of a running pod and thus the allocation. When we take these
things into account I do think that we need to be careful about removing things
that we might later need.
It might even make more sense to align the user and group usage updates to what
the queue does. We can then put a generic handling on top of that for how we
handle changes for running pods. Thoughts?
> Remove unnecessary boolean return value from the tracking code
> --------------------------------------------------------------
>
> Key: YUNIKORN-2423
> URL: https://issues.apache.org/jira/browse/YUNIKORN-2423
> Project: Apache YuniKorn
> Issue Type: Sub-task
> Components: core - scheduler
> Reporter: Peter Bacsko
> Assignee: Peter Bacsko
> Priority: Minor
> Labels: pull-request-available
>
> QueueTracker has two methods which both have an unnecessary return value:
>
> {noformat}
> increaseTrackedResource() bool
> decreaseTrackedResource() (bool, bool)
> {noformat}
> The value from {{increaseTrackedResource()}} is always true. It used to be
> different, but it no longer has any relevance.
> Same goes for {{{}decreaseTrackedResource(){}}}, only the first boolean can
> change which indicates whether a tracker can be removed.
> Also, {{UserTracker.increaseTrackedResource()}} can be simplified as the
> increment always succeeds and does not need to return anything:
> {noformat}
> func (ut *UserTracker) increaseTrackedResource(queuePath string,
> applicationID string, usage *resources.Resource) bool {
> ut.Lock()
> defer ut.Unlock()
> hierarchy := strings.Split(queuePath, configs.DOT)
> ut.events.sendIncResourceUsageForUser(ut.userName, queuePath, usage)
> increased := ut.queueTracker.increaseTrackedResource(hierarchy,
> applicationID, user, usage)
> if increased {
> ... // branch always taken
> }
> return increased
> }
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]