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

Viraj Jasani edited comment on HDFS-17017 at 5/19/23 5:55 AM:
--------------------------------------------------------------

anyways, in order to prevent "any new argument for any of the existing 
commands" from running into similar "exhausting max arguments" case, what can 
we do? can we write a test that can parse all possible arguments for the given 
command ("-report" in this case) and pass them all and ensure that the output 
return code/exit code still remains 0?

if we have such test, then whenever someone introduces a new argument in 
future, the test will automatically pass the argument to the command and the 
test would fail, forcing dev to handle the "max argument" case.

 

[~haiyang Hu] i have attached the patch on the PR to make the test more robust, 
and cover the missing case of identifying whether we have exceeded max 
arguments and need to adjust max arguments allowed for -report command. Thank 
you.


was (Author: vjasani):
anyways, in order to prevent "any new argument for any of the existing 
commands" from running into similar "exhausting max arguments" case, what can 
we do? can we write a test that can parse all possible arguments for the given 
command ("-report" in this case) and pass them all and ensure that the output 
return code/exit code still remains 0?

if we have such test, then whenever someone introduces a new argument in 
future, the test will automatically pass the argument to the command and the 
test would fail, forcing dev to handle the "max argument" case.

> Fix the issue of arguments number limit in report command in DFSAdmin.
> ----------------------------------------------------------------------
>
>                 Key: HDFS-17017
>                 URL: https://issues.apache.org/jira/browse/HDFS-17017
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Haiyang Hu
>            Assignee: Haiyang Hu
>            Priority: Major
>
> Currently, the DFSAdmin report command should support a maximum number of 
> arguments of 7, such as :
> hdfs dfsadmin [-report] [-live] [-dead] [-decommissioning] 
> [-enteringmaintenance] [-inmaintenance] [-slownodes]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to