You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Xintong Song (JIRA)" <ji...@apache.org> on 2018/07/13 03:51:00 UTC

[jira] [Created] (YARN-8528) ContainerAllocation.state should be private and unchangeable

Xintong Song created YARN-8528:
----------------------------------

             Summary: ContainerAllocation.state should be private and unchangeable
                 Key: YARN-8528
                 URL: https://issues.apache.org/jira/browse/YARN-8528
             Project: Hadoop YARN
          Issue Type: Bug
          Components: capacity scheduler
            Reporter: Xintong Song


ContainerAllocation.LOCALITY_SKIPPED is final static, and its .state should always be AllocationState.LOCALITY_SKIPPED. However, this variable is public and is accidentally changed to AllocationState.APP_SKIPPED in RegularContainerAllocator. The consequences are codes using ContainerAllocation.LOCALITY_SKIPPED and expecting AllocationState.LOCALITY_SKIPPED are actually getting AllocationState.APP_SKIPPED.

Similar risks exist for ContainerAllocation.PRIORITY_SKIPPED/APP_SKIPPED/QUEUE_SKIPPED. 

ContainerAllocation.state should be private and should not be changed. If changes are needed, a new ContainerAllocation should be created.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org