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

DataNode runs async disk checks maybe throws NullPointerException, and DataNode failed to register to NameSpace.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.8.0, 3.0.0
    • None
    • hdfs
    • hadoop-2.7.3, hadoop-2.8.0

    • Reviewed
    • Hide
       this.completedChecks = new ReferenceMap(1, 1);
      or
       this.completedChecks = new HashMap<>();
      Show
       this.completedChecks = new ReferenceMap(1, 1); or  this.completedChecks = new HashMap<>();
    • HDFS, DiskChecks
    • Patch

    Description

      In ThrottledAsyncChecker class,it members of the completedChecks is WeakHashMap, its definition is as follows:
           this.completedChecks = new WeakHashMap<>();

      and one of its uses is as follows in schedule method:
          if (completedChecks.containsKey(target))

      {         // here may be happen garbage collection,and result may be null.          final LastCheckResult<V> result = completedChecks.get(target);          final long msSinceLastCheck = timer.monotonicNow() - result.completedAt;     }

      after  "completedChecks.containsKey(target)",  may be happen garbage collection,  and result may be null.

       

      Attachments

        1. image-2018-11-13-20-23-26-813.png
          110 kB
          guangyi lu
        2. image-2018-11-13-20-23-22-138.png
          110 kB
          guangyi lu

        Issue Links

          Activity

            People

              Unassigned Unassigned
              luguangyi guangyi lu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 48h
                  48h
                  Remaining:
                  Remaining Estimate - 48h
                  48h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified