[jira] [Commented] (YARN-3484) Fix up yarn top shell code
[ https://issues.apache.org/jira/browse/YARN-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14534877#comment-14534877 ] Allen Wittenauer commented on YARN-3484: * Some shellcheck errors: {code} hadoop-yarn-project/hadoop-yarn/bin/yarn:65:13: warning: Declare and assign separately to avoid masking return values. [SC2155] hadoop-yarn-project/hadoop-yarn/bin/yarn:72:13: warning: Declare and assign separately to avoid masking return values. [SC2155] {code} * If the RM isn't up, we throw an exception. * tput stderr needs to be /dev/null'd > Fix up yarn top shell code > -- > > Key: YARN-3484 > URL: https://issues.apache.org/jira/browse/YARN-3484 > Project: Hadoop YARN > Issue Type: Bug > Components: scripts >Affects Versions: 3.0.0 >Reporter: Allen Wittenauer >Assignee: Varun Vasudev > Labels: BB2015-05-TBR, newbie > Attachments: YARN-3484.001.patch, YARN-3484.002.patch > > > We need to do some work on yarn top's shell code. > a) Just checking for TERM isn't good enough. We really need to check the > return on tput, especially since the output will not be a number but an error > string which will likely blow up the java code in horrible ways. > b) All the single bracket tests should be double brackets to force the bash > built-in. > c) I'd think I'd rather see the shell portion in a function since it's rather > large. This will allow for args, etc, to get local'ized and clean up the > case statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (YARN-3484) Fix up yarn top shell code
[ https://issues.apache.org/jira/browse/YARN-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14528701#comment-14528701 ] Junping Du commented on YARN-3484: -- I won't get a chance to look at this (or any other non-bug bash related patches) until Friday. Please do not commit it yet. I really don't want to open another jira to fix this again. Thanks. Understand. Please take your time. I will leave this JIRA for you to review/commit. :) > Fix up yarn top shell code > -- > > Key: YARN-3484 > URL: https://issues.apache.org/jira/browse/YARN-3484 > Project: Hadoop YARN > Issue Type: Bug > Components: scripts >Affects Versions: 3.0.0 >Reporter: Allen Wittenauer >Assignee: Varun Vasudev > Labels: newbie > Attachments: YARN-3484.001.patch, YARN-3484.002.patch > > > We need to do some work on yarn top's shell code. > a) Just checking for TERM isn't good enough. We really need to check the > return on tput, especially since the output will not be a number but an error > string which will likely blow up the java code in horrible ways. > b) All the single bracket tests should be double brackets to force the bash > built-in. > c) I'd think I'd rather see the shell portion in a function since it's rather > large. This will allow for args, etc, to get local'ized and clean up the > case statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (YARN-3484) Fix up yarn top shell code
[ https://issues.apache.org/jira/browse/YARN-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14528661#comment-14528661 ] Allen Wittenauer commented on YARN-3484: I won't get a chance to look at this (or any other non-bug bash related patches) until Friday. Please do not commit it yet. I really don't want to open another jira to fix this again. Thanks. > Fix up yarn top shell code > -- > > Key: YARN-3484 > URL: https://issues.apache.org/jira/browse/YARN-3484 > Project: Hadoop YARN > Issue Type: Bug > Components: scripts >Affects Versions: 3.0.0 >Reporter: Allen Wittenauer >Assignee: Varun Vasudev > Labels: newbie > Attachments: YARN-3484.001.patch, YARN-3484.002.patch > > > We need to do some work on yarn top's shell code. > a) Just checking for TERM isn't good enough. We really need to check the > return on tput, especially since the output will not be a number but an error > string which will likely blow up the java code in horrible ways. > b) All the single bracket tests should be double brackets to force the bash > built-in. > c) I'd think I'd rather see the shell portion in a function since it's rather > large. This will allow for args, etc, to get local'ized and clean up the > case statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (YARN-3484) Fix up yarn top shell code
[ https://issues.apache.org/jira/browse/YARN-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14528397#comment-14528397 ] Junping Du commented on YARN-3484: -- Latest patch LGTM. [~aw], do you have any further comments? If not, I will go ahead to commit v2 patch soon. Thx! > Fix up yarn top shell code > -- > > Key: YARN-3484 > URL: https://issues.apache.org/jira/browse/YARN-3484 > Project: Hadoop YARN > Issue Type: Bug > Components: scripts >Affects Versions: 3.0.0 >Reporter: Allen Wittenauer >Assignee: Varun Vasudev > Labels: newbie > Attachments: YARN-3484.001.patch, YARN-3484.002.patch > > > We need to do some work on yarn top's shell code. > a) Just checking for TERM isn't good enough. We really need to check the > return on tput, especially since the output will not be a number but an error > string which will likely blow up the java code in horrible ways. > b) All the single bracket tests should be double brackets to force the bash > built-in. > c) I'd think I'd rather see the shell portion in a function since it's rather > large. This will allow for args, etc, to get local'ized and clean up the > case statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (YARN-3484) Fix up yarn top shell code
[ https://issues.apache.org/jira/browse/YARN-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14519636#comment-14519636 ] Hadoop QA commented on YARN-3484: - \\ \\ | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || | {color:blue}0{color} | pre-patch | 0m 0s | Pre-patch trunk compilation is healthy. | | {color:green}+1{color} | @author | 0m 0s | The patch does not contain any @author tags. | | {color:green}+1{color} | whitespace | 0m 0s | The patch has no lines that end in whitespace. | | {color:green}+1{color} | release audit | 0m 15s | The applied patch does not increase the total number of release audit warnings. | | {color:blue}0{color} | shellcheck | 0m 15s | Shellcheck was not available. | | | | 0m 23s | | \\ \\ || Subsystem || Report/Notes || | Patch URL | http://issues.apache.org/jira/secure/attachment/12729211/YARN-3484.002.patch | | Optional Tests | shellcheck | | git revision | trunk / 8f82970 | | Java | 1.7.0_55 | | uname | Linux asf905.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | | Console output | https://builds.apache.org/job/PreCommit-YARN-Build/7542/console | This message was automatically generated. > Fix up yarn top shell code > -- > > Key: YARN-3484 > URL: https://issues.apache.org/jira/browse/YARN-3484 > Project: Hadoop YARN > Issue Type: Bug > Components: scripts >Affects Versions: 3.0.0 >Reporter: Allen Wittenauer >Assignee: Varun Vasudev > Attachments: YARN-3484.001.patch, YARN-3484.002.patch > > > We need to do some work on yarn top's shell code. > a) Just checking for TERM isn't good enough. We really need to check the > return on tput, especially since the output will not be a number but an error > string which will likely blow up the java code in horrible ways. > b) All the single bracket tests should be double brackets to force the bash > built-in. > c) I'd think I'd rather see the shell portion in a function since it's rather > large. This will allow for args, etc, to get local'ized and clean up the > case statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (YARN-3484) Fix up yarn top shell code
[ https://issues.apache.org/jira/browse/YARN-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14513135#comment-14513135 ] Allen Wittenauer commented on YARN-3484: * variables that are local to a function should be declared local. * avoid using mixed case as per the shell programming guidelines * yarnTopArgs is effectively a global. It should either get renamed to YARN_foo or another to not pollute the shell name space or another approach is process set_yarn_top_args as a subshell, reading its input directly to avoid the global entirely * set_yarn_top_args should be hadoop_ something so as to not pollute the shell name space * nit: technically, TERM isn't guaranteed to be set on all OSes under all workable modes, since it is the login process' responsibility to set it. However, almost all modern systems do set it and it's fairly reliable. I think it's OK to leave the check, but I wanted to make this comment here for future readers in case they hit the situation where TERM wasn't set for their particular system. Yes, that situation was thought about, but honestly, upgrade. > Fix up yarn top shell code > -- > > Key: YARN-3484 > URL: https://issues.apache.org/jira/browse/YARN-3484 > Project: Hadoop YARN > Issue Type: Bug > Components: scripts >Affects Versions: 3.0.0 >Reporter: Allen Wittenauer >Assignee: Varun Vasudev > Attachments: YARN-3484.001.patch > > > We need to do some work on yarn top's shell code. > a) Just checking for TERM isn't good enough. We really need to check the > return on tput, especially since the output will not be a number but an error > string which will likely blow up the java code in horrible ways. > b) All the single bracket tests should be double brackets to force the bash > built-in. > c) I'd think I'd rather see the shell portion in a function since it's rather > large. This will allow for args, etc, to get local'ized and clean up the > case statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (YARN-3484) Fix up yarn top shell code
[ https://issues.apache.org/jira/browse/YARN-3484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14504660#comment-14504660 ] Hadoop QA commented on YARN-3484: - {color:red}-1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12726827/YARN-3484.001.patch against trunk revision d52de61. {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:red}-1 tests included{color}. 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:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 javadoc{color}. There were no new javadoc warning messages. {color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse. {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 2.0.3) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 core tests{color}. The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-YARN-Build/7420//testReport/ Console output: https://builds.apache.org/job/PreCommit-YARN-Build/7420//console This message is automatically generated. > Fix up yarn top shell code > -- > > Key: YARN-3484 > URL: https://issues.apache.org/jira/browse/YARN-3484 > Project: Hadoop YARN > Issue Type: Bug > Components: scripts >Affects Versions: 3.0.0 >Reporter: Allen Wittenauer >Assignee: Varun Vasudev > Attachments: YARN-3484.001.patch > > > We need to do some work on yarn top's shell code. > a) Just checking for TERM isn't good enough. We really need to check the > return on tput, especially since the output will not be a number but an error > string which will likely blow up the java code in horrible ways. > b) All the single bracket tests should be double brackets to force the bash > built-in. > c) I'd think I'd rather see the shell portion in a function since it's rather > large. This will allow for args, etc, to get local'ized and clean up the > case statement. -- This message was sent by Atlassian JIRA (v6.3.4#6332)