[core] Fix leak for subscribing to object dependencies in NodeManager (#7630)

* Fix GetDependencies

* lint
This commit is contained in:
Stephanie Wang
2020-03-18 11:01:29 -07:00
committed by GitHub
parent ea10cd212c
commit 35a4bfc885
+5 -3
View File
@@ -2252,9 +2252,10 @@ void NodeManager::AsyncResolveObjects(
if (ray_get) {
// TODO(ekl) using the assigned task id is a hack to handle unsubscription for
// HandleDirectCallUnblocked.
task_dependency_manager_.SubscribeGetDependencies(
mark_worker_blocked ? current_task_id : worker->GetAssignedTaskId(),
required_object_ids);
auto &task_id = mark_worker_blocked ? current_task_id : worker->GetAssignedTaskId();
if (!task_id.IsNil()) {
task_dependency_manager_.SubscribeGetDependencies(task_id, required_object_ids);
}
} else {
task_dependency_manager_.SubscribeWaitDependencies(worker->WorkerId(),
required_object_ids);
@@ -2456,6 +2457,7 @@ bool NodeManager::FinishAssignedTask(Worker &worker) {
}
// Notify the task dependency manager that this task has finished execution.
task_dependency_manager_.UnsubscribeGetDependencies(spec.TaskId());
task_dependency_manager_.TaskCanceled(task_id);
// Unset the worker's assigned job Id if this is not an actor.