FileUploader: fix race with partial location deletion
GitOrigin-RevId: fa3cd8ca2cd5b376d557242a6b5f296dc09c90f4
This commit is contained in:
parent
24f31ad888
commit
e1046570a3
@ -145,7 +145,7 @@ Result<FileLoader::PrefixInfo> FileUploader::on_update_local_location(const Loca
|
|||||||
is_temp = true;
|
is_temp = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!path.empty() && path != fd_path_) {
|
if (!path.empty() && (path != fd_path_ || fd_.empty())) {
|
||||||
auto res_fd = FileFd::open(path, FileFd::Read);
|
auto res_fd = FileFd::open(path, FileFd::Read);
|
||||||
|
|
||||||
// Race: partial location could be already deleted. Just ignore such locations
|
// Race: partial location could be already deleted. Just ignore such locations
|
||||||
@ -164,8 +164,6 @@ Result<FileLoader::PrefixInfo> FileUploader::on_update_local_location(const Loca
|
|||||||
fd_ = res_fd.move_as_ok();
|
fd_ = res_fd.move_as_ok();
|
||||||
fd_path_ = path;
|
fd_path_ = path;
|
||||||
is_temp_ = is_temp;
|
is_temp_ = is_temp;
|
||||||
} else if (!fd_path_.empty()) {
|
|
||||||
TRY_STATUS(acquire_fd());
|
|
||||||
}
|
}
|
||||||
if (local_is_ready) {
|
if (local_is_ready) {
|
||||||
CHECK(!fd_.empty());
|
CHECK(!fd_.empty());
|
||||||
|
Loading…
Reference in New Issue
Block a user