[Core] Simplify logic in node manager class. (#11063)

Co-authored-by: 逗角 <yeqing.fyq@antfin.com>
This commit is contained in:
fang yeqing 2020-09-28 16:54:06 +08:00 committed by GitHub
parent 142234cbcb
commit 0765d989ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1814,13 +1814,8 @@ void NodeManager::HandlePrepareBundleResources(
RAY_LOG(DEBUG) << "Request to prepare bundle resources is received, " RAY_LOG(DEBUG) << "Request to prepare bundle resources is received, "
<< bundle_spec.DebugString(); << bundle_spec.DebugString();
auto prepared = PrepareBundle(cluster_resource_map_, bundle_spec); auto prepared = PrepareBundle(cluster_resource_map_, bundle_spec);
if (!prepared) { reply->set_success(prepared);
reply->set_success(false); send_reply_callback(Status::OK(), nullptr, nullptr);
send_reply_callback(Status::OK(), nullptr, nullptr);
} else {
reply->set_success(true);
send_reply_callback(Status::OK(), nullptr, nullptr);
}
// Call task dispatch to assign work to the new group. // Call task dispatch to assign work to the new group.
TryLocalInfeasibleTaskScheduling(); TryLocalInfeasibleTaskScheduling();
DispatchTasks(local_queues_.GetReadyTasksByClass()); DispatchTasks(local_queues_.GetReadyTasksByClass());