[core] Don't log actor restart warning if arg is detached actor #57931
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.
Description
Ray Data doesn't want this warning log to show on all workloads. Now, they pass a detached ActorLocationTracker into actors with max_restarts > 0. A detached actor won't go out of scope, so as long as it isn't ray.killed it'll still exist when the actor with it as an arg needs to restart. See - #57838 - minimal ray data usage will result in the log now.
We'll revert this logic back once #53727 is fixed.
Here I'm just checking if an inlined arg passed by ref is a detached actor. If it is, we'll skip setting the warning flag so we won't log the warning. The actor handle has no way of knowing whether the actor is detached so I had to create that path.
Used this script to test that we don't log the warning.
Note: There's one gotcha here - is_detached doesn't get through all the way if you're passing the actor handle around because the serialization doesn't take it into account, I'll fix this in a follow up right after