Skip to content
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

Links to exiting actors don't get cleaned up properly #3920

Closed
scabug opened this issue Oct 14, 2010 · 4 comments
Closed

Links to exiting actors don't get cleaned up properly #3920

scabug opened this issue Oct 14, 2010 · 4 comments
Assignees

Comments

@scabug
Copy link

scabug commented Oct 14, 2010

If I link two actors (Parent <-> Child) and Child exits, a reference to it will be kept in Parent#links forever. It can be mitigated somewhat by manually unlinking in Parent when it receives the Exit message, but it is tedious and bug-prone.

To reproduce this: open a REPL and paste the contents of testcase.scala. Wait until it prints the "child exited" messages and then take a heap dump using any available tool (e.g. jvisualvm). It will show 4 instances of Child as not being available for GC because they're referenced from Parent#links.

This could probably be fixed easily by changing a line in the exitLinked() method from mylinks.foreach(unlinkFrom(_)) to mylinks.foreach(_.unlinkFrom(this)).

@scabug
Copy link
Author

scabug commented Oct 14, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3920?orig=1
Reporter: Alexey Ermakov (zee)
Attachments:

  • 3920.patch (created on Oct 16, 2010 11:21:34 AM UTC, 598 bytes)
  • testcase.scala (created on Oct 14, 2010 10:32:39 AM UTC, 592 bytes)

@scabug
Copy link
Author

scabug commented Oct 14, 2010

Alexey Ermakov (zee) said:
Test case

@scabug
Copy link
Author

scabug commented Oct 15, 2010

Alexey Ermakov (zee) said:
Changing the unlinkFrom invocation as described leads to deadlock.

I've attached the patch that fixes the issue by removing the links a bit later. I've tested the fix on our system and it seems to work correctly.

@scabug
Copy link
Author

scabug commented Oct 26, 2010

@phaller said:
(In r23370) Closes #3920. Review by prokopec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants