Skip to content

Commit

Permalink
fix hdfs download command will always return succeeded (#4723)
Browse files Browse the repository at this point in the history
  • Loading branch information
critical27 authored Oct 14, 2022
1 parent 74a6577 commit b552f9b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/common/hdfs/HdfsCommandHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Status HdfsCommandHelper::ls(const std::string& hdfsHost,
auto result = proc.wait();
if (!result.exited()) {
return Status::Error("Failed to ls hdfs");
} else if (result.exitStatus() != 0) {
LOG(INFO) << "Failed to ls: " << result.str();
return Status::Error("Failed to ls hdfs, errno: %d", result.exitStatus());
} else {
return Status::OK();
}
Expand All @@ -47,6 +50,9 @@ Status HdfsCommandHelper::copyToLocal(const std::string& hdfsHost,
auto result = proc.wait();
if (!result.exited()) {
return Status::Error("Failed to download from hdfs");
} else if (result.exitStatus() != 0) {
LOG(INFO) << "Failed to download: " << result.str();
return Status::Error("Failed to download from hdfs, errno: %d", result.exitStatus());
} else {
return Status::OK();
}
Expand Down

0 comments on commit b552f9b

Please sign in to comment.