Skip to content

[Java] Release actor instance reference when Ray.exitActor() is invoked#11324

Merged
kfstorm merged 4 commits intoray-project:masterfrom
antgroup:java_fix_exit_actor_oom
Oct 14, 2020
Merged

[Java] Release actor instance reference when Ray.exitActor() is invoked#11324
kfstorm merged 4 commits intoray-project:masterfrom
antgroup:java_fix_exit_actor_oom

Conversation

@kfstorm
Copy link
Copy Markdown
Member

@kfstorm kfstorm commented Oct 10, 2020

Why are these changes needed?

If the number of Java workers per process is set to be greater than 1, a Java worker process can hold multiple actors. If one of them calls Ray.exitActor(), the underlying CoreWorker instance and the underlying thread will exit, but the actor instance remains in TaskExecutor.actorContextMap, which is a memory leak bug.

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Copy link
Copy Markdown
Contributor

@ffbin ffbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kfstorm There is windows compile error.

@ffbin ffbin added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Oct 12, 2020
@kfstorm
Copy link
Copy Markdown
Member Author

kfstorm commented Oct 13, 2020

@ffbin fixed.

@kfstorm kfstorm removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Oct 13, 2020
Copy link
Copy Markdown
Contributor

@ffbin ffbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@chaokunyang chaokunyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kfstorm kfstorm merged commit abc6126 into ray-project:master Oct 14, 2020
@kfstorm kfstorm deleted the java_fix_exit_actor_oom branch October 14, 2020 05:13
edoakes pushed a commit that referenced this pull request Jun 2, 2025
…er (#53389)

Just removing an unused relic. 

`on_worker_shutdown` callback was introduced in #11324 (in case of
multiple workers per Java process) but later removed in #26497

Signed-off-by: Sagar Sumit <sagarsumit09@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants