FileLoader: restart cancelled queries

GitOrigin-RevId: e71c71b25098631ca68de852eece9cb9a37ec775
This commit is contained in:
Arseny Smirnov 2018-12-28 09:42:36 +03:00
parent b4adf4f64f
commit 89d5d680d6

View File

@ -238,6 +238,9 @@ void FileLoader::on_result(NetQueryPtr query) {
bool next = false;
auto status = [&] {
TRY_RESULT(should_restart, should_restart_part(part, query));
if (query->is_error() && query->error().code() == NetQuery::Error::Cancelled) {
should_restart = true;
}
if (should_restart) {
VLOG(files) << "Restart part " << tag("id", part.id) << tag("size", part.size);
resource_state_.stop_use(static_cast<int64>(part.size));