hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "guangyi lu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HDFS-14074) DataNode runs async disk checks maybe throws NullPointerException, and DataNode failed to register to NameSpace.
Date Tue, 13 Nov 2018 12:40:00 GMT

     [ https://issues.apache.org/jira/browse/HDFS-14074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

guangyi lu updated HDFS-14074:
------------------------------
    Release Note:   (was:  this.completedChecks = new ReferenceMap(1, 1);
or
 this.completedChecks = new HashMap<>();)
     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.

the solution is:

this.completedChecks = new ReferenceMap(1, 1);
or
 this.completedChecks = new HashMap<>();

 

  was:
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.

 

!image-2018-11-13-20-23-26-813.png!


> DataNode runs async disk checks  maybe  throws NullPointerException, and DataNode failed
to register to NameSpace.
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-14074
>                 URL: https://issues.apache.org/jira/browse/HDFS-14074
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs
>    Affects Versions: 2.8.0, 3.0.0
>         Environment: hadoop-2.7.3, hadoop-2.8.0
>            Reporter: guangyi lu
>            Priority: Major
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> 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.
> the solution is:
> this.completedChecks = new ReferenceMap(1, 1);
> or
>  this.completedChecks = new HashMap<>();
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message