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

Actors are not unsubscribed from DistributedPubSub on termination #24294

Closed
naiello opened this Issue Jan 11, 2018 · 2 comments

Comments

Projects
None yet
5 participants
@naiello
Contributor

naiello commented Jan 11, 2018

Hi all. I hit a problem today where it appears the DistributedPubSub system is not automatically unsubscribing actors from topics when they terminate (which is contrary to the PubSub documentation). I have a snippet demonstrating this behavior here. Since references to the ActorRef instances are retained by the DistributedPubSubMediator, the JVM can't garbage collect them and they accumulate on the heap.

After investigating the issue, I found this (L350). It appears the Terminated message handler in TopicLike removes the dead subscriber from the set, but the Terminated handler is overridden via .orElse in the Topic class, and the behavior is not replicated in Topic.

I'd be happy to submit a pull request against this tomorrow.

@patriknw

This comment has been minimized.

Show comment
Hide comment
@patriknw

patriknw Jan 12, 2018

Member

@naiello Thanks for finding this. It must be regression. PR is much welcome.

Member

patriknw commented Jan 12, 2018

@naiello Thanks for finding this. It must be regression. PR is much welcome.

@jbergfi

This comment has been minimized.

Show comment
Hide comment
@jbergfi

jbergfi Feb 2, 2018

We've struck into the exact same issue and I created another PR #24485 before noticing this issue and PR.
There might be other similar bugs with the TopicLike & Topic class, might be worth for someone with better knowledge than me to have a look over the other messages that are overriden.

jbergfi commented Feb 2, 2018

We've struck into the exact same issue and I created another PR #24485 before noticing this issue and PR.
There might be other similar bugs with the TopicLike & Topic class, might be worth for someone with better knowledge than me to have a look over the other messages that are overriden.

@ktoso ktoso closed this in #24343 Feb 16, 2018

ktoso added a commit that referenced this issue Feb 16, 2018

[#24294] Fix DistributedPubSubMediator not unsubscribing actors from … (
#24343)

* [#24294] Fix DistributedPubSubMediator not unsubscribing actors from topics when they terminate.

* Removed rogue "with DeadLetterProbe"

* Update DistributedPubSubMediator.scala

@ktoso ktoso removed the 3 - in progress label Feb 16, 2018

@ktoso ktoso added this to the 2.5.10 milestone Feb 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment