Thank you Martynas for your help.
I've dropped down to 2.3.0 and modified the Worker so that it stays alive. (
commit<https://github.com/Synesso/scratch-akka-cluster-singleton/commit/cc25ea6b92546095276b0d49cf7452b376fec1c2>).
Retesting, I get a different result to you. The app honours the
ClusterRouterPoolSetting *totalInstances*, but it ignores *maxInstancesPerNode
*and *allowLocalRoutees*.
With Akka 2.3.0 and this code inside a Cluster Singleton:
context.actorOf(ClusterRouterPool(
RoundRobinPool(10),
ClusterRouterPoolSettings(
totalInstances = 30,
maxInstancesPerNode = 10,
allowLocalRoutees = false,
useRole = None)
).props(Props[Worker]), name = "worker-router")
I see that 30 workers are created on that node and nothing on any other.
Is creating the router inside a singleton somehow locking the routees down
to that node? Why do you and I see different results for the same source?
Cheers
Jem
On 8 April 2014 23:15, Martynas Mickevičius <
[email protected]> wrote:
> 1. Despite using a router to distribute work to the
> workers<https://github.com/Synesso/scratch-akka-cluster-singleton/blob/distributed/src/main/scala/sample/cluster/simple/TheFatController.scala#L24>,
>> all work continues to happen on the same node (even when max workers is
>> reached for that node).
>>
>
> This can be caused by the known
> regression<https://www.assembla.com/spaces/akka/simple_planner#/ticket:3967>in
> akka 2.3.1. In that case the second node is unable to join the cluster,
> so all work happens on the first node. I have tried your example code with
> akka 2.3.0 and workers are being distributed between two or more nodes.
>
> 2. Despite stopping the
> workers<https://github.com/Synesso/scratch-akka-cluster-singleton/blob/distributed/src/main/scala/sample/cluster/simple/Worker.scala#L11>,
>> the system is unable to process work once the max number of
>> workers<https://github.com/Synesso/scratch-akka-cluster-singleton/blob/distributed/src/main/scala/sample/cluster/simple/TheFatController.scala#L29>is
>> hit.
>>
>> I hope someone can help me as I can't see what I've done wrong.
>>
>
> I see that you are stopping workers with a PoisonPill message. This stops
> the worker and its mailbox. In this case router is not going to restart
> workers. However if you use Kill message to kill worker, then
> ActorKilledException is thrown in the worker which kills the worker but
> also notifies the router. Router will act (escalate, restart, ...) to this
> exception according to its supervision strategy.
>
> Martynas Mickevičius
> Typesafe - Reactive Apps on the JVM
>
> --
> >>>>>>>>>> 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/KMBzbh8lXZg/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 http://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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.