Remove distributed pubsub nodes on leave #20826
This ensures that gracefully leaving nodes (which would terminate after their own removed event) are already unregistered on all other pubsub nodes, before termination.
This commit is contained in:
parent
6777e7f7d9
commit
fcd290cd9a
1 changed files with 6 additions and 0 deletions
|
|
@ -666,6 +666,12 @@ class DistributedPubSubMediator(settings: DistributedPubSubSettings) extends Act
|
|||
if (matchingRole(m))
|
||||
nodes += m.address
|
||||
|
||||
case MemberLeft(m) ⇒
|
||||
if (matchingRole(m)) {
|
||||
nodes -= m.address
|
||||
registry -= m.address
|
||||
}
|
||||
|
||||
case MemberRemoved(m, _) ⇒
|
||||
if (m.address == selfAddress)
|
||||
context stop self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue