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

Bibin A Chundatt updated HADOOP-13035:
--------------------------------------
    Attachment: 0002-HADOOP-13035.patch

[~leftnoteasy]
Thank you for looking into patch

Corrected cases for TestServiceLifecycle as mentioned below and have query for 
two cases

# {{TestServiceLifecycle#testStartInInitService}} services is trying to start 
in Init.Since the state is not yet set as INITED start will not be allowed. 
Please advice 
# {{TestServiceLifecycle#testStopFailingInitAndStop}} when init Is failing 
testcase checks for state to be INITED as per earlier implementation.
changed state to NOTINITED in Assertion.
# Notify listener shouldnt happen once the state is STOPPED added condition in 
{{start and init}} to handle the case.
# {{TestCompositeService}} testclass {{maybeAddSibling()}} changed to pass the 
state expected.


> AbstractService should set state only after state change
> --------------------------------------------------------
>
>                 Key: HADOOP-13035
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13035
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Bibin A Chundatt
>         Attachments: 0001-HADOOP-13035.patch, 0002-HADOOP-13035.patch
>
>
> As per the discussion in YARN-3971 the we should be setting the service state 
> to STARTED only after serviceStart() 
> Currently {{AbstractService#start()}} is set
> {noformat} 
>      if (stateModel.enterState(STATE.STARTED) != STATE.STARTED) {
>         try {
>           startTime = System.currentTimeMillis();
>           serviceStart();
> ..
>  }
> {noformat}
> enterState sets the service state to proposed state. So in 
> {{service.getServiceState}} in {{serviceStart()}} will return STARTED .



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to