-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stability] Make task result for RemoveTask optional #5146
[stability] Make task result for RemoveTask optional #5146
Conversation
Test FAILed. |
Test FAILed. |
Test PASSed. |
Test FAILed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I am a little confused, though, about when we should RAY_CHECK
the RemoveTask
return value and when we should just exit if no task was removed... can the bug affect any of the RemoveTask
calls or is it only some of them?
src/ray/raylet/scheduling_queue.cc
Outdated
@@ -247,7 +247,8 @@ std::vector<Task> SchedulingQueue::RemoveTasks(std::unordered_set<TaskID> &task_ | |||
return removed_tasks; | |||
} | |||
|
|||
Task SchedulingQueue::RemoveTask(const TaskID &task_id, TaskState *removed_task_state) { | |||
boost::optional<Task> SchedulingQueue::RemoveTask(const TaskID &task_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about a signature like this instead?
bool SchedulingQueue::RemoveTask(const TaskID &task_id, TaskState *removed_task_state, Task *removed_task);
I was thinking that it might be good to make sure that the caller doesn't try to use the TaskState
if the function returns false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that first (and it's nicer), but it involved needing a default constructor for Task and TaskSpecification and TaskExecutionSpecification :)
@@ -1035,6 +1039,8 @@ void NodeManager::ProcessDisconnectClientMessage( | |||
<< "job_id: " << worker->GetAssignedJobId(); | |||
} | |||
|
|||
client->Close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this part of the bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was another bug where we were running out of file descriptors.
I updated the PR description with the current theory of which calls it affects. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test FAILed. |
Test PASSed. |
@stephanie-wang This is ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good!
Actually, thinking about it more, I'm pretty sure that this bug can come up pretty much anywhere we call RemoveTask
. But let's see how this works first...
What do these changes do?
This fixes the long-running stress test https://github.com/ray-project/ray/blob/master/ci/long_running_tests/workloads/many_drivers.py. It fixes a race condition where Task information is removed when a driver is disconnected but then still further used.
The current hypothesis is that this concerns only the SWAP queue, so there are still some checks left in. If other queues are also affected, we might need to make them non-fatal too.
Related issue number
Linter
scripts/format.sh
to lint the changes in this PR.