diff --git a/src/CraneCtld/CtldGrpcServer.cpp b/src/CraneCtld/CtldGrpcServer.cpp index 8c974b48..07931ca6 100644 --- a/src/CraneCtld/CtldGrpcServer.cpp +++ b/src/CraneCtld/CtldGrpcServer.cpp @@ -999,8 +999,8 @@ CtldServer::SubmitTaskToScheduler(std::unique_ptr task) { return result::fail( result.reason); } - std::string errorMessage = std::string(CraneErrStr(result.err)) + ": " + result.reason; - return result::fail(errorMessage.c_str()); + std::string error_message = std::string(CraneErrStr(result.err)) + ": " + result.reason; + return result::fail(error_message.c_str()); } } // namespace Ctld diff --git a/src/CraneCtld/TaskScheduler.cpp b/src/CraneCtld/TaskScheduler.cpp index ab26a6c7..2abde418 100644 --- a/src/CraneCtld/TaskScheduler.cpp +++ b/src/CraneCtld/TaskScheduler.cpp @@ -2804,7 +2804,7 @@ Result TaskScheduler::CheckTaskValidity(TaskInCtld* task) { // Since we do not access the elements in partition_metas_m // Check whether the selected partition is able to run this task. - if (!(task->requested_node_res_view * task->node_num <= +if (!(task->requested_node_res_view * task->node_num <= metas_ptr->partition_global_meta.res_total_inc_dead)) { CRANE_TRACE( "Resource not enough for task #{}. "