Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hdfs download command will always return succeeded sometimes #4723

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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