Repository navigation
[Core] Fix a check failure where removing PG fails to return the PG resources - #53195
Merged
Merged
Conversation
Signed-off-by: Jiajun Yao <[email protected]>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Example of sequence of events that causes this check failure is:
CancelResourceReserveRPC is sent to the raylet.CancelResourceReservehandler first tries to cancel any lease requests in the local task manager that need the PG resource AND is WAITING_FOR_WORKER. In this case there is none of them.DestroyWorkerwhich callsDisconnectClient.DisconnectClientfirst releases the PG resource used by the first actor since it's killed (PG_CPU_RESOURCE: [1/1]) and it callsScheduleAndDispatchTaskswhich unblocks the second actor and the just released PG resource is claimed by the second actor immediatelyray/src/ray/raylet/local_task_manager.cc
Line 335 in 9b1917a
ray/src/ray/raylet/node_manager.cc
Line 2169 in 9b1917a
The fix is that when the PG is removed, we should cancel the actor 2 lease request as well. So by the time we
DestroyWorkerof actor 1, actor 2 lease request is already cancelled and removed from the local task manager dispatch queue so that it won't have chance to acquire the PG resource released by the first actor.This is the minimal fix for #51124 and I have a follow-up #52751 to make the relevant code cleaner and add c++ unit tests after #53120 is merged.
Related issue number
Closes #51124
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.