-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[Core] Decrement lineage ref count of an actor when the actor task return object reference is deleted #46230
Conversation
…ject reference is deleted Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
if (it->second.spec.IsActorTask()) { | ||
// We need to decrement the actor lineage ref count here | ||
// since it's incremented during TaskManager::AddPendingTask. | ||
const auto actor_creation_return_id = it->second.spec.ActorCreationDummyObjectId(); | ||
released_objects->push_back(actor_creation_return_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.
Actual fix
@@ -82,33 +82,6 @@ inline std::shared_ptr<ray::rpc::ErrorTableData> CreateErrorTableData( | |||
return error_info_ptr; | |||
} | |||
|
|||
/// Helper function to produce actor table data. | |||
inline std::shared_ptr<ray::rpc::ActorTableData> CreateActorTableData( |
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 just unused?
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.
Yes, dead code
@jjyao Hello, I would like to ask, what phenomenon will this issue cause? Will it only affect the scenario where the Actor fails and retries? Or could it potentially lead to memory leaks during the execution of the Actor tasks? I want to determine whether an upgrade to the latest version is necessary. Thanks. |
Why are these changes needed?
When an actor method is called, the actor lineage ref count increments as it's seen as a dependency of the actor task.
However, when we know that the actor task won't be retried (i.e. the return object is out of scope), we forget to decrement the actor lineage ref count.
This PR fixes this so that we have a matching pair of increment and decrement.
Also removed some dead code.
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.