From 7611e484ec5b95c18fbdcd6a493944fdccb45367 Mon Sep 17 00:00:00 2001 From: Zhijun Fu <37800433+zhijunfu@users.noreply.github.com> Date: Thu, 5 Dec 2019 13:37:52 +0800 Subject: [PATCH] properly handle a forwarded task that gets forwarded back (#6271) --- src/ray/raylet/node_manager.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ray/raylet/node_manager.cc b/src/ray/raylet/node_manager.cc index fae949196..2714451a9 100644 --- a/src/ray/raylet/node_manager.cc +++ b/src/ray/raylet/node_manager.cc @@ -2814,6 +2814,12 @@ void NodeManager::ForwardTask( client->ForwardTask(request, [this, on_error, task, task_id, node_id]( Status status, const rpc::ForwardTaskReply &reply) { + if (local_queues_.HasTask(task_id)) { + // It must have been forwarded back to us if it's in the queue again + // so just return here. + return; + } + if (status.ok()) { const auto &spec = task.GetTaskSpecification(); // Mark as forwarded so that the task and its lineage are not