In a sharded system the life-cycle of the actor is controlled by the Shard
actor. So if you are subscribing to distributed pub/sub in your actor's
constructor or receive method and you passivate there is no way for the
Shard actor to respawn your passivated actor because the message isn't
coming through the ShardRegion. Also we found out that unless we call
"unsubscribe" in the preStop method we were leaking actor references since
the mediator doesn't know your actor no longer exists and just sends the
messages to dead-letters.

On Thu, Mar 9, 2017 at 9:51 AM, Richard Rodseth <[email protected]> wrote:

> Is it true that
>
>    - Passivated (sleeping) actors aren't able to listen to the pub/sub
>    topic.
>
> ?
>
> Unfortunately there's no answer here:
> http://stackoverflow.com/questions/40782570/can-akka-
> distributedpubsub-deal-with-passivated-subscribers
>
> On Wed, Mar 8, 2017 at 6:18 PM, Richard Ney <[email protected]>
> wrote:
>
>> Environment:
>>
>>    - Distributed cluster with persistence sharded actors.
>>    - Persistent actors are setup to Passivate when inactive.
>>    - All actors have the Backoff Supervisor wrapping the actual
>>    persistent actor
>>    - Shard regions are common across our users
>>
>> Problem:
>>
>>    - At times it's required to reset the actor states
>>    - Live actors currently listen to a Distributed Pub/Sub topics for
>>    the reset message at which point they reset state and save a snapshot of
>>    the state.
>>    - Passivated (sleeping) actors aren't able to listen to the pub/sub
>>    topic.
>>    - Sending message to restore actor just to reset its state is a
>>    needless load on the persistence data store since we could play back 1000s
>>    of messages before wiping state.
>>
>> Question:
>>
>>    - How can I either send a message or pass a dynamic parameter into a
>>    Sharded Persistent Actor so I can disable recovery before the actor starts
>>    loading from the data store?
>>
>>
>> -Thanks
>>
>>
>> Richard
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c
>> urrent/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/cGrx2jLrn58/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to