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

Avoid race conditions when attempts operate on shared states concurrently

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.6.0
    • None
    • resourcemanager
    • None

    Description

      In AttemptFailedTransition, new attempt will get states('justFinishedContainers' and 'finishedContainersSentToAM') reference from failed attempt. Then these attempts share the two states(previous attempts also share the two states). Suppose two or more CONTAINER_FINISHED events for different attempts are handled at the same time, and suppose they ran on same node. Attempts will update justFinishedContainers's same key's value concurrently. Although 'justFinishedContainers' is a ConcurrentHashMap, operations on its value 'List<ContainerStatus>' is not atomic, namely

      appAttempt.justFinishedContainers.get(containerFinishedEvent.getNodeId()).add(containerFinishedEvent.getContainerStatus())

      is not atomic.

      Attachments

        1. YARN-3389.01.patch
          3 kB
          Jun Gong

        Activity

          People

            hex108 Jun Gong
            hex108 Jun Gong
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: