Change cancellation reason for Backups timeout.

This commit is contained in:
Yarik Briukhovetskyi 2024-11-20 01:27:41 +01:00 committed by GitHub
parent 7599020b87
commit 8d43e3bc90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 4 deletions

View File

@ -747,7 +747,7 @@ void BackupCoordinationStageSync::cancelQueryIfDisconnectedTooLong()
/// we don't want the watching thread to try waiting here for retries or a reconnection).
/// Also we don't set the `state.host_with_error` field here because `state.host_with_error` can only be set
/// AFTER creating the 'error' node (see the comment for `State`).
process_list_element->cancelQuery(CancelReason::TIMEOUT, exception);
process_list_element->cancelQuery(CancelReason::CANCELLED_BY_USER, exception);
state_changed.notify_all();
}

View File

@ -509,10 +509,7 @@ void QueryStatus::throwProperExceptionIfNeeded(const UInt64 & max_execution_time
additional_error_part = fmt::format("elapsed {} ms, ", static_cast<double>(elapsed_ns) / 1000000000ULL);
if (cancel_reason == CancelReason::TIMEOUT)
{
cancel_reason = CancelReason::UNDEFINED; // We can assign only CancelReason::TIMEOUT to cancel_reason, so we need to assign it back to UNDEFINED
throw Exception(ErrorCodes::TIMEOUT_EXCEEDED, "Timeout exceeded: {}maximum: {} ms", additional_error_part, max_execution_time / 1000.0);
}
throwQueryWasCancelled();
}
}