diff --git a/be/src/http/http_client.cpp b/be/src/http/http_client.cpp index e94614788f5236..bf1cd751ae37dd 100644 --- a/be/src/http/http_client.cpp +++ b/be/src/http/http_client.cpp @@ -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; }