You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2017/11/14 20:50:00 UTC

[jira] [Commented] (HADOOP-14807) should prevent the possibility of NPE about ReconfigurableBase.java

    [ https://issues.apache.org/jira/browse/HADOOP-14807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16252157#comment-16252157 ] 

Hadoop QA commented on HADOOP-14807:
------------------------------------

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue}  0m 16s{color} | {color:blue} Docker mode activated. {color} |
|| || || || {color:brown} Prechecks {color} ||
| {color:green}+1{color} | {color:green} @author {color} | {color:green}  0m  0s{color} | {color:green} The patch does not contain any @author tags. {color} |
| {color:red}-1{color} | {color:red} test4tests {color} | {color:red}  0m  0s{color} | {color:red} The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color} |
|| || || || {color:brown} trunk Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 14m 47s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 11m 17s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 29s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  1m  0s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green}  9m 50s{color} | {color:green} branch has no errors when building and testing our client artifacts. {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green}  1m 19s{color} | {color:green} trunk passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 46s{color} | {color:green} trunk passed {color} |
|| || || || {color:brown} Patch Compile Tests {color} ||
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green}  0m 41s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 10m 43s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green} 10m 43s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green}  0m 36s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} mvnsite {color} | {color:green}  1m  0s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green}  0m  0s{color} | {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} shadedclient {color} | {color:green}  9m 25s{color} | {color:green} patch has no errors when building and testing our client artifacts. {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green}  1m 33s{color} | {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green}  0m 53s{color} | {color:green} the patch passed {color} |
|| || || || {color:brown} Other Tests {color} ||
| {color:green}+1{color} | {color:green} unit {color} | {color:green}  7m 16s{color} | {color:green} hadoop-common in the patch passed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green}  0m 25s{color} | {color:green} The patch does not generate ASF License warnings. {color} |
| {color:black}{color} | {color:black} {color} | {color:black} 72m 10s{color} | {color:black} {color} |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | Client=17.05.0-ce Server=17.05.0-ce Image:yetus/hadoop:5b98639 |
| JIRA Issue | HADOOP-14807 |
| JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12883655/HADOOP-14807.001.patch |
| Optional Tests |  asflicense  compile  javac  javadoc  mvninstall  mvnsite  unit  shadedclient  findbugs  checkstyle  |
| uname | Linux 899b13d490f2 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | /testptch/patchprocess/precommit/personality/provided.sh |
| git revision | trunk / 18621af |
| maven | version: Apache Maven 3.3.9 |
| Default Java | 1.8.0_151 |
| findbugs | v3.1.0-RC1 |
|  Test Results | https://builds.apache.org/job/PreCommit-HADOOP-Build/13681/testReport/ |
| Max. process+thread count | 1421 (vs. ulimit of 5000) |
| modules | C: hadoop-common-project/hadoop-common U: hadoop-common-project/hadoop-common |
| Console output | https://builds.apache.org/job/PreCommit-HADOOP-Build/13681/console |
| Powered by | Apache Yetus 0.7.0-SNAPSHOT   http://yetus.apache.org |


This message was automatically generated.



> should prevent the possibility of  NPE about ReconfigurableBase.java
> --------------------------------------------------------------------
>
>                 Key: HADOOP-14807
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14807
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 3.0.0-alpha3
>            Reporter: hu xiaodong
>            Assignee: hu xiaodong
>            Priority: Minor
>         Attachments: HADOOP-14807.001.patch
>
>
> 1.NameNode.java may throw a ReconfigurationException which getCause() is null
> {code:title=NameNode.java|borderStyle=solid}  
>   protected String reconfigurePropertyImpl(String property, String newVal)
>       throws ReconfigurationException {
>     final DatanodeManager datanodeManager = namesystem.getBlockManager()
>         .getDatanodeManager();
>     if (property.equals(DFS_HEARTBEAT_INTERVAL_KEY)) {
>       return reconfHeartbeatInterval(datanodeManager, property, newVal);
>     } else if (property.equals(DFS_NAMENODE_HEARTBEAT_RECHECK_INTERVAL_KEY)) {
>       return reconfHeartbeatRecheckInterval(datanodeManager, property, newVal);
>     } else if (property.equals(FS_PROTECTED_DIRECTORIES)) {
>       return reconfProtectedDirectories(newVal);
>     } else if (property.equals(HADOOP_CALLER_CONTEXT_ENABLED_KEY)) {
>       return reconfCallerContextEnabled(newVal);
>     } else if (property.equals(ipcClientRPCBackoffEnable)) {
>       return reconfigureIPCBackoffEnabled(newVal);
>     } 
>    //=======================================================
>    //here may throw a ReconfigurationException which getCause() is null
>    //=======================================================
>    else {
>       throw new ReconfigurationException(property, newVal, getConf().get(
>           property));
>     }
>   }
> {code}
> 2.  ReconfigurationThread.java will call ReconfigurationException.getCause().getMessage() which will cause NPE.
> {code:title=ReconfigurationThread.java|borderStyle=solid}  
> private static class ReconfigurationThread extends Thread {
>     private ReconfigurableBase parent;
>     ReconfigurationThread(ReconfigurableBase base) {
>       this.parent = base;
>     }
>     // See {@link ReconfigurationServlet#applyChanges}
>     public void run() {
>       LOG.info("Starting reconfiguration task.");
>       final Configuration oldConf = parent.getConf();
>       final Configuration newConf = parent.getNewConf();
>       final Collection<PropertyChange> changes =
>           parent.getChangedProperties(newConf, oldConf);
>       Map<PropertyChange, Optional<String>> results = Maps.newHashMap();
>       ConfigRedactor oldRedactor = new ConfigRedactor(oldConf);
>       ConfigRedactor newRedactor = new ConfigRedactor(newConf);
>       for (PropertyChange change : changes) {
>         String errorMessage = null;
>         String oldValRedacted = oldRedactor.redact(change.prop, change.oldVal);
>         String newValRedacted = newRedactor.redact(change.prop, change.newVal);
>         if (!parent.isPropertyReconfigurable(change.prop)) {
>           LOG.info(String.format(
>               "Property %s is not configurable: old value: %s, new value: %s",
>               change.prop,
>               oldValRedacted,
>               newValRedacted));
>           continue;
>         }
>         LOG.info("Change property: " + change.prop + " from \""
>             + ((change.oldVal == null) ? "<default>" : oldValRedacted)
>             + "\" to \""
>             + ((change.newVal == null) ? "<default>" : newValRedacted)
>             + "\".");
>         try {
>           String effectiveValue =
>               parent.reconfigurePropertyImpl(change.prop, change.newVal);
>           if (change.newVal != null) {
>             oldConf.set(change.prop, effectiveValue);
>           } else {
>             oldConf.unset(change.prop);
>           }
>         } catch (ReconfigurationException e) {
>           //===============================================
>           // here may occurs NPE,  because  e.getCause() may be null.
>           //===============================================
>           errorMessage = e.getCause().getMessage();
>         }
>         results.put(change, Optional.fromNullable(errorMessage));
>       }
>       synchronized (parent.reconfigLock) {
>         parent.endTime = Time.now();
>         parent.status = Collections.unmodifiableMap(results);
>         parent.reconfigThread = null;
>       }
>     }
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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