Junping Du commented on YARN-3304:

bq. Do we expect the code to be the following?
That's right.

bq.  If so, how do we handle the usage being available at the time of calling 
isAvailable, and not being available at the time of calling getUsage? To avoid 
this issue, we could get the usage on the availability call and cache it, and 
the getUsage call would return this cached value?
I don't quite understand this.  We will always call pTree.updateProcessTree() 
to have a snapshot of processor info before we are consuming the CPU/Memory 
data there. I don't see any differences with adding an additional check for 
availability here. Am I missing something here?

bq. But, requiring the availability call now is an even more incompatible 
change, no? 
I was thinking check availability call is not a must, but only in case we want 
to tell different between 0 value and not available. Previous code (like 
resource counters in MR) can still get value of 0 which sounds more compatible 
for me. 

bq. What is the cost of breaking compat of this previously Private API? I have 
a feeling it would be worth not making the API super-complicated.
My concern is not only breaking previous Private API of 
ResourceCalculatorProcessTree, but also break the consistency of behavior (and 
bring odd result) to things like: MapReduce resource counter. It never get 
negative value previously. 

bq. I want to avoid fixing this in a hurry just to unblock the release. I am 
willing to prioritize this, chat offline if need be, and solve it the right 
+1. That's also what I wish.

bq. If we think that is too slow, we could always revert YARN-3296 for 2.7.
I don't prefer to do this unless we run out of time.

BTW, [~adhoot], I will look at your patch in YARN-3392. Thanks!

> ResourceCalculatorProcessTree#getCpuUsagePercent default return value is 
> inconsistent with other getters
> --------------------------------------------------------------------------------------------------------
>                 Key: YARN-3304
>                 URL: https://issues.apache.org/jira/browse/YARN-3304
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: nodemanager
>            Reporter: Junping Du
>            Assignee: Karthik Kambatla
>            Priority: Blocker
>         Attachments: YARN-3304-v2.patch, YARN-3304.patch
> Per discussions in YARN-3296, getCpuUsagePercent() will return -1 for 
> unavailable case while other resource metrics are return 0 in the same case 
> which sounds inconsistent.

This message was sent by Atlassian JIRA

Reply via email to