Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.14
-
None
-
None
-
C#
Description
Currently in HdfsCommandRunner, the function LogCommandOutput(CommandResult result) logs the output generated when the command is executed in internal CommandResult Run(string hdfsCommandLineArguments). However, in the current code we just check whether result is null or not and then just terminate if result exists. However, we never log or check the exit variable. If it is zero we should declare operation to be success otherwise keep trying. Infact, result will never be null. Also after maximum retries, the thrown exception does not show result logs as part of exception which contain vital information for debugging. The code is pasted below for reference also.
for (var attemptNumber = 0; attemptNumber < _numberOfRetries; ++attemptNumber) { var processName = String.Format("HDFS_Attempt_{0}_of_{1}", attemptNumber, _numberOfRetries); var result = RunAttempt(processStartInfo, _timeOutInMilliSeconds, processName); if (null != result) { LogCommandOutput(result); return result; } } // If we reached here, we ran out of retries. throw new Exception( string.Format("HDFS Cmd {0} {1} could not be executed in the specified timeout & retry settings", _hdfsCommandPath, hdfsCommandLineArguments));
The main aim of JIRA is to introduce more elaborate logging and checking in the Run function. Specifically, we would like to check the exit message and then write appropriate messages.