diff --git a/src/Backups/BackupCoordinationStageSync.cpp b/src/Backups/BackupCoordinationStageSync.cpp index b16306cd0c6..db0672c7c2e 100644 --- a/src/Backups/BackupCoordinationStageSync.cpp +++ b/src/Backups/BackupCoordinationStageSync.cpp @@ -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(); } diff --git a/src/Interpreters/ProcessList.cpp b/src/Interpreters/ProcessList.cpp index f2382177ddf..970a4929d28 100644 --- a/src/Interpreters/ProcessList.cpp +++ b/src/Interpreters/ProcessList.cpp @@ -509,10 +509,7 @@ void QueryStatus::throwProperExceptionIfNeeded(const UInt64 & max_execution_time additional_error_part = fmt::format("elapsed {} ms, ", static_cast(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(); } }