Fix RAY_ENABLE_NEW_SCHEDULER=1 pytest test_advanced_2.py::test_zero_cpus_actor (#11817)

This commit is contained in:
Eric Liang
2020-11-05 16:02:04 -08:00
committed by GitHub
parent 347e871409
commit f86c4f992c
4 changed files with 16 additions and 29 deletions
+2 -6
View File
@@ -610,9 +610,7 @@ void NodeManager::WarnResourceDeadlock() {
SchedulingResources &local_resources = cluster_resource_map_[self_node_id_];
error_message
<< "The actor or task with ID " << exemplar.GetTaskSpecification().TaskId()
<< " is pending and cannot currently be scheduled. It requires "
<< exemplar.GetTaskSpecification().GetRequiredResources().ToString()
<< " for execution and "
<< " cannot be scheduled right now. It requires "
<< exemplar.GetTaskSpecification().GetRequiredPlacementResources().ToString()
<< " for placement, but this node only has remaining "
<< local_resources.GetAvailableResources().ToString() << ". In total there are "
@@ -2087,9 +2085,7 @@ void NodeManager::ScheduleTasks(
std::ostringstream error_message;
error_message
<< "The actor or task with ID " << task.GetTaskSpecification().TaskId()
<< " is infeasible and cannot currently be scheduled. It requires "
<< task.GetTaskSpecification().GetRequiredResources().ToString()
<< " for execution and "
<< " cannot be scheduled right now. It requires "
<< task.GetTaskSpecification().GetRequiredPlacementResources().ToString()
<< " for placement, however the cluster currently cannot provide the requested "
"resources. The required resources may be added as autoscaling takes place "
@@ -30,13 +30,14 @@ bool ClusterTaskManager::SchedulePendingTasks() {
// tasks from being scheduled.
Work work = *work_it;
Task task = std::get<0>(work);
auto request_resources =
task.GetTaskSpecification().GetRequiredResources().GetResourceMap();
auto placement_resources =
task.GetTaskSpecification().GetRequiredPlacementResources().GetResourceMap();
int64_t _unused;
// TODO (Alex): We should distinguish between infeasible tasks and a fully
// utilized cluster.
std::string node_id_string = cluster_resource_scheduler_->GetBestSchedulableNode(
request_resources, task.GetTaskSpecification().IsActorCreationTask(), &_unused);
placement_resources, task.GetTaskSpecification().IsActorCreationTask(),
&_unused);
if (node_id_string.empty()) {
// There is no node that has available resources to run the request.
// Move on to the next shape.
@@ -49,8 +50,9 @@ bool ClusterTaskManager::SchedulePendingTasks() {
did_schedule = task_scheduled || did_schedule;
} else {
// Should spill over to a different node.
cluster_resource_scheduler_->AllocateRemoteTaskResources(node_id_string,
request_resources);
cluster_resource_scheduler_->AllocateRemoteTaskResources(
node_id_string,
task.GetTaskSpecification().GetRequiredResources().GetResourceMap());
NodeID node_id = NodeID::FromBinary(node_id_string);
auto node_info_opt = get_node_info_(node_id);