Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-8331

Race condition in NM container launched after done

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0, 2.9.1, 3.0.2
    • Fix Version/s: 2.10.0, 3.2.0, 2.9.2, 3.0.4, 3.1.2
    • Component/s: None
    • Labels:
      None

      Description

      When a container is launching, in ContainerLaunch#launchContainer, state is SCHEDULED,
      kill event was sent to this container, state : SCHEDULED->KILLING->DONE
      Then ContainerLaunch send CONTAINER_LAUNCHED event and start the container processes. These absent container processes will not be cleaned up anymore.

       

      2018-05-21 13:11:56,114 INFO  [Thread-11] nodemanager.NMAuditLogger (NMAuditLogger.java:logSuccess(94)) - USER=nobody	OPERATION=Start Container Request	TARGET=ContainerManageImpl	RESULT=SUCCESS	APPID=application_0_0000	CONTAINERID=container_0_0000_01_000000
      2018-05-21 13:11:56,114 INFO  [NM ContainerManager dispatcher] application.ApplicationImpl (ApplicationImpl.java:handle(632)) - Application application_0_0000 transitioned from NEW to INITING
      2018-05-21 13:11:56,114 INFO  [NM ContainerManager dispatcher] application.ApplicationImpl (ApplicationImpl.java:transition(446)) - Adding container_0_0000_01_000000 to application application_0_0000
      2018-05-21 13:11:56,118 INFO  [NM ContainerManager dispatcher] application.ApplicationImpl (ApplicationImpl.java:handle(632)) - Application application_0_0000 transitioned from INITING to RUNNING
      2018-05-21 13:11:56,119 INFO  [NM ContainerManager dispatcher] container.ContainerImpl (ContainerImpl.java:handle(2111)) - Container container_0_0000_01_000000 transitioned from NEW to SCHEDULED
      2018-05-21 13:11:56,119 INFO  [NM ContainerManager dispatcher] containermanager.AuxServices (AuxServices.java:handle(220)) - Got event CONTAINER_INIT for appId application_0_0000
      2018-05-21 13:11:56,119 INFO  [NM ContainerManager dispatcher] scheduler.ContainerScheduler (ContainerScheduler.java:startContainer(504)) - Starting container [container_0_0000_01_000000]
      2018-05-21 13:11:56,226 INFO  [NM ContainerManager dispatcher] container.ContainerImpl (ContainerImpl.java:handle(2111)) - Container container_0_0000_01_000000 transitioned from SCHEDULED to KILLING
      2018-05-21 13:11:56,227 INFO  [NM ContainerManager dispatcher] containermanager.TestContainerManager (BaseContainerManagerTest.java:delete(287)) - Psuedo delete: user - nobody, type - FILE
      2018-05-21 13:11:56,227 INFO  [NM ContainerManager dispatcher] nodemanager.NMAuditLogger (NMAuditLogger.java:logSuccess(94)) - USER=nobody	OPERATION=Container Finished - Killed	TARGET=ContainerImpl	RESULT=SUCCESS	APPID=application_0_0000	CONTAINERID=container_0_0000_01_000000
      2018-05-21 13:11:56,238 INFO  [NM ContainerManager dispatcher] container.ContainerImpl (ContainerImpl.java:handle(2111)) - Container container_0_0000_01_000000 transitioned from KILLING to DONE
      2018-05-21 13:11:56,238 INFO  [NM ContainerManager dispatcher] application.ApplicationImpl (ApplicationImpl.java:transition(489)) - Removing container_0_0000_01_000000 from application application_0_0000
      2018-05-21 13:11:56,239 INFO  [NM ContainerManager dispatcher] monitor.ContainersMonitorImpl (ContainersMonitorImpl.java:onStopMonitoringContainer(932)) - Stopping resource-monitoring for container_0_0000_01_000000
      2018-05-21 13:11:56,239 INFO  [NM ContainerManager dispatcher] containermanager.AuxServices (AuxServices.java:handle(220)) - Got event CONTAINER_STOP for appId application_0_0000
      2018-05-21 13:11:56,274 WARN  [NM ContainerManager dispatcher] container.ContainerImpl (ContainerImpl.java:handle(2106)) - Can't handle this event at current state: Current: [DONE], eventType: [CONTAINER_LAUNCHED], container: [container_0_0000_01_000000]
      org.apache.hadoop.yarn.state.InvalidStateTransitionException: Invalid event: CONTAINER_LAUNCHED at DONE
      	at org.apache.hadoop.yarn.state.StateMachineFactory.doTransition(StateMachineFactory.java:305)
      	at org.apache.hadoop.yarn.state.StateMachineFactory.access$500(StateMachineFactory.java:46)
      	at org.apache.hadoop.yarn.state.StateMachineFactory$InternalStateMachine.doTransition(StateMachineFactory.java:487)
      	at org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl.handle(ContainerImpl.java:2104)
      	at org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl.handle(ContainerImpl.java:104)
      	at org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl$ContainerEventDispatcher.handle(ContainerManagerImpl.java:1525)
      	at org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl$ContainerEventDispatcher.handle(ContainerManagerImpl.java:1518)
      	at org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:197)
      	at org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:126)
      	at java.lang.Thread.run(Thread.java:748)
      

        Attachments

        1. YARN-8331.001.patch
          10 kB
          Pradeep Ambati
        2. YARN-8331.002.patch
          12 kB
          Pradeep Ambati

          Issue Links

            Activity

              People

              • Assignee:
                pradeepambati Pradeep Ambati
                Reporter:
                fly_in_gis Yang Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: