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

DataXceiver hung due to the lock in FsDatasetImpl#getBlockInputStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.1
    • 3.3.0, 3.2.1, 3.1.3
    • datanode
    • None

    Description

      DataXceiver hung due to the lock that locked by
      FsDatasetImpl#getBlockInputStream (have attached stack).

        @Override // FsDatasetSpi
        public InputStream getBlockInputStream(ExtendedBlock b,
            long seekOffset) throws IOException {
      
          ReplicaInfo info;
          synchronized(this) {
            info = volumeMap.get(b.getBlockPoolId(), b.getLocalBlock());
          }
          ...
        }
      

      The lock synchronized(this) used here is expensive, there is already one AutoCloseableLock type lock defined for ReplicaMap. We can use it instead.

      Attachments

        1. HDFS-13359.001.patch
          0.8 kB
          Yiqun Lin
        2. stack.jpg
          249 kB
          Yiqun Lin

        Issue Links

          Activity

            People

              linyiqun Yiqun Lin
              linyiqun Yiqun Lin
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: