From 0765d989ae2344e6bdfd0e343bd284579469da3c Mon Sep 17 00:00:00 2001 From: fang yeqing <592202890@qq.com> Date: Mon, 28 Sep 2020 16:54:06 +0800 Subject: [PATCH] [Core] Simplify logic in node manager class. (#11063) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 逗角 --- src/ray/raylet/node_manager.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ray/raylet/node_manager.cc b/src/ray/raylet/node_manager.cc index 3cce1eb45..da9d72c8e 100644 --- a/src/ray/raylet/node_manager.cc +++ b/src/ray/raylet/node_manager.cc @@ -1814,13 +1814,8 @@ void NodeManager::HandlePrepareBundleResources( RAY_LOG(DEBUG) << "Request to prepare bundle resources is received, " << bundle_spec.DebugString(); auto prepared = PrepareBundle(cluster_resource_map_, bundle_spec); - if (!prepared) { - reply->set_success(false); - send_reply_callback(Status::OK(), nullptr, nullptr); - } else { - reply->set_success(true); - send_reply_callback(Status::OK(), nullptr, nullptr); - } + reply->set_success(prepared); + send_reply_callback(Status::OK(), nullptr, nullptr); // Call task dispatch to assign work to the new group. TryLocalInfeasibleTaskScheduling(); DispatchTasks(local_queues_.GetReadyTasksByClass());