Skip to content

Commit

Permalink
[fix](http) Remove file if downloading faile is failed apache#41778 (a…
Browse files Browse the repository at this point in the history
…pache#41827)

cherry pick from apache#41778
  • Loading branch information
w41ter authored Oct 15, 2024
1 parent 736bb16 commit 77fbe63
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion be/src/http/http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,13 @@ Status HttpClient::download(const std::string& local_path) {
}
return true;
};
RETURN_IF_ERROR(execute(callback));

if (auto s = execute(callback); !s.ok()) {
status = s;
}
if (!status.ok()) {
remove(local_path.c_str());
}
return status;
}

Expand Down

0 comments on commit 77fbe63

Please sign in to comment.