Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-4359

remove an unnecessary synchronized keyword in BPOfferService.java

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2-alpha, 3.0.0-alpha1
    • Fix Version/s: 2.0.3-alpha
    • Component/s: datanode
    • Labels:
      None

      Description

      we encountered a NN&DN hung issue, the DN hung was caused by no NN response for heartbeat. Per DN thread dump, i think we can have a little improvement on this detail code :

      synchronized List<BPServiceActor> getBPServiceActors()

      { return Lists.newArrayList(bpServices); }

      the bpServices is declared as :

      private List<BPServiceActor> bpServices =
      new CopyOnWriteArrayList<BPServiceActor>();

      It's a thread-safe variant indead, so we can remove the above synchronized keyword safely, IMHO.

      Here is a simple statistic for thread dump:
      xieliang@xieliang:/tmp$ grep 0x00000007b00289f0 dn.jstack |wc -l
      252

        Attachments

        1. nn_dns_broken.jstack
          903 kB
          Liang Xie
        2. HDFS-4359.txt
          0.6 kB
          Liang Xie
        3. dn.jstack
          876 kB
          Liang Xie

          Activity

            People

            • Assignee:
              xieliang007 Liang Xie
              Reporter:
              xieliang007 Liang Xie
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: