Always set correct file_type in on_update_local_location.
GitOrigin-RevId: b94e23635d7d975361ab1af2c5dd06fbecf62e42
This commit is contained in:
parent
6b04ed9d4a
commit
2bfc3578f6
@ -907,7 +907,7 @@ inline bool operator!=(const FullLocalFileLocation &lhs, const FullLocalFileLoca
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline StringBuilder &operator<<(StringBuilder &sb, const FullLocalFileLocation &location) {
|
inline StringBuilder &operator<<(StringBuilder &sb, const FullLocalFileLocation &location) {
|
||||||
return sb << '[' << location.file_type_ << "] at \"" << location.path_ << '"';
|
return sb << "[full local location of " << location.file_type_ << "] at \"" << location.path_ << '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
class LocalFileLocation {
|
class LocalFileLocation {
|
||||||
|
@ -122,6 +122,12 @@ Result<FileLoader::PrefixInfo> FileUploader::on_update_local_location(const Loca
|
|||||||
file_type = location.full().file_type_;
|
file_type = location.full().file_type_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG(INFO) << "In FileUploader::on_update_local_location with " << location << ". Have path = \"" << path
|
||||||
|
<< "\", local_size = " << local_size << ", local_is_ready = " << local_is_ready
|
||||||
|
<< " and file type = " << file_type;
|
||||||
|
|
||||||
|
file_type_ = file_type;
|
||||||
|
|
||||||
bool is_temp = false;
|
bool is_temp = false;
|
||||||
if (encryption_key_.is_secure() && local_is_ready) {
|
if (encryption_key_.is_secure() && local_is_ready) {
|
||||||
TRY_RESULT(file_fd_path, open_temp_file(FileType::Temp));
|
TRY_RESULT(file_fd_path, open_temp_file(FileType::Temp));
|
||||||
@ -140,6 +146,7 @@ Result<FileLoader::PrefixInfo> FileUploader::on_update_local_location(const Loca
|
|||||||
// Race: partial location could be already deleted. Just ignore such locations
|
// Race: partial location could be already deleted. Just ignore such locations
|
||||||
if (res_fd.is_error()) {
|
if (res_fd.is_error()) {
|
||||||
if (location.type() == LocalFileLocation::Type::Partial) {
|
if (location.type() == LocalFileLocation::Type::Partial) {
|
||||||
|
LOG(INFO) << "Ignore partial local location: " << res_fd.error();
|
||||||
PrefixInfo info;
|
PrefixInfo info;
|
||||||
info.size = local_size_;
|
info.size = local_size_;
|
||||||
info.is_ready = local_is_ready_;
|
info.is_ready = local_is_ready_;
|
||||||
@ -176,7 +183,6 @@ Result<FileLoader::PrefixInfo> FileUploader::on_update_local_location(const Loca
|
|||||||
expected_size_ = local_size_;
|
expected_size_ = local_size_;
|
||||||
}
|
}
|
||||||
local_is_ready_ = local_is_ready;
|
local_is_ready_ = local_is_ready;
|
||||||
file_type_ = file_type;
|
|
||||||
|
|
||||||
PrefixInfo info;
|
PrefixInfo info;
|
||||||
info.size = local_size_;
|
info.size = local_size_;
|
||||||
|
Reference in New Issue
Block a user