These are chat archives for akkadotnet/akka.net

11th
Dec 2016
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 09:37

@dubrovkinmaxim it won't happen at once, as you're requesting a deliveries one by one. But yes, in general redeliveries can stack up, up to a number specified at akka.persistence.at-least-once-delivery.max-unconfirmed-messages (it's 100 000 by default). When this threshold will be surpassed all calls for Deliver() method will automatically fail fast.

You can also get notified about something wrong happening here, as after several unconfirmed redelivery attempts (value specified at akka.persistence.at-least-once-delivery.warn-after-number-of-unconfirmed-attempts which is 5 by default) AtLeastOnceDeliveryActor will receive UnconfirmedWarning message with all messages that haven't been confirmed more than this number of times.

Claudio Bernasconi
@claudiobernasconi
Dec 11 2016 11:50
@Horusiath Thank you very much for your help regarding stashing. I implemented it and it works great. My next question is, how can I make use of clustering? I mean technically I already implemented clustering, but now I want to scale adding a new node to the cluster. The problem is that if i send some work it gets round-robined to the existing 10 instances of the JobCoordinatorActor in Node1. If I add another Node to the system, it does not get any work, because it just starts its new set of JobCoordinatorActors which don't get any work assigned. What am I doing wrong here? How can I setup my system to make use of newly added nodes?
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 12:11
@claudiobernasconi you can get more info on cluster routers here. I'm not an expert on these, but AFAIK clustered router should know how to spawn routees on each node (ofc if it's configured as a pool router). You can read config to configure how many routees should be spawned on each node and how many of them could be spawned in total. From what I remember 2 things to remember here are:
  1. Router won't migrate existing routees when new node has been added. It can just spawn more of them. If you need automatic actor rebalancing Akka.Cluster.Sharding is what you need.
  2. Keep in mind that stashing will saturate router mailbox. What I mean here is if you have i.e. 20 messages in router mailbox, and it has 5 routees on a single node, where each one of these routees stashes all messages until some specific message will arrive, then those routees can empty router mailbox even thou they cannot process those messages right away. So if you put another node here, but no new messages arrived, routees spawned on that node won't get any remaining of those 20 messages, since they have been send by the router already to corresponding routees on the first node, where they got stashed.
Claudio Bernasconi
@claudiobernasconi
Dec 11 2016 12:15
@Horusiath Thank you very much. You helped me again a lot. I will dive deep into this. One question regarding your 2nd point: Seems like my design is not ideal considering the bahaviour of the system you describe. Is there a possibility to design the system in a way that the messages are kept in the queue of the (Cluster)router so that they will be routed only if a JobCoordinatorActor is ready to process it? This way the system could scale if I add a new node to the cluster. In my understanding the system cannot scale if I'm using the stashing as I do it right now.
The reason why I (have to) stash is that I want to keep track of the progress of the child actors of the JobCoordinatorActor. So the JobCoordinatorActor basically receives two kind of messages. Those with the workload and those with the progress information of its child. As long as not all of the children have completed, it cannot work on a new workload. If you do not understand my case here I am willing to draw a diagram to express clearly what I am talking about. Just ask, please.
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 12:20
If you need to track a completion, maybe put it into a separate actor? I've created a simple sample on that back on SO - it's called aggregator pattern.
you basically create an actor and say it how much of the work is there to be done. then all of the workers will notify their completion not to JobCoordinatorActor but to Aggregator instead. Once everyone have completed their job, aggregator will notify someone about completion, partial completion or failure.
Horusiath @Horusiath afk
Claudio Bernasconi
@claudiobernasconi
Dec 11 2016 12:28
Thanks I'll dig into this as well.
Claudio Bernasconi
@claudiobernasconi
Dec 11 2016 12:42
Okay, instead of instantiating a pool-router in code, I make use of the creation in the config file. This way I should be able to use a clustered router, right? So I replace var jobCoordinatorRouter = actorSystem.ActorOf(actorSystem.DI().Props<JobCoordinatorActor>().WithRouter(new RoundRobinPool(5)), "JobCoordinator"); with the following snippet in the HOCON file:
deployment {
/JobCoordinator {
router = round-robin-pool
nr-of-instances = 20
cluster {
enabled = on
allow-local-routees = on
use-role = prototype
max-nr-of-instances-per-node = 5
}
}
}
How can I specify in the HOCON file which underlaying routee actor should be used? In the code line above I was selecting the JobCoordinatorActor as routee. In the HOCON file I am not specifing which routee to be used. Therefore my application does not process any work any more :-/.
Andrey Leskov
@andreyleskov
Dec 11 2016 13:28
Hi all, is their any guide how to diagnose performance issues with akka.net ?
Classic performance monitors like DotTrace or Ants Profilers shows tons of threads and it is hard to understand anything
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 14:43
@claudiobernasconi Props.Create<JobCoordinatorActor>().WithRouter(FromConfig.Instance)
Maxim
@dubrovkinmaxim
Dec 11 2016 16:38
@Horusiath Thank you!
Maxim
@dubrovkinmaxim
Dec 11 2016 16:43
Sergey Prytkov
@Rattenkrieg
Dec 11 2016 18:22
Hi guys, can I run only tests that are in specific project with provided FAKE script?
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 18:32
@Rattenkrieg you can alter FAKE script to contain specific path only - !! is used to create path filter and AFAIK it can be used with ++ or -- to include/exclude other filters
Sergey Prytkov
@Rattenkrieg
Dec 11 2016 18:35
@Horusiath but there is no option to pass desired project(assembly) name as argument to that script?
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 18:36
I don't think so
Sergey Prytkov
@Rattenkrieg
Dec 11 2016 18:36
ok, thanks
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 18:36
usually we make use of R# for running specific tests
Sergey Prytkov
@Rattenkrieg
Dec 11 2016 18:39
there are some weird issues with my VS/R# - it can't locate any tests, so I felt lazy to investigate and tried to figure out another way to run tests
but seems there is no easier way than to fix VS/R#
Bartosz Sypytkowski
@Horusiath
Dec 11 2016 18:40
R# sometimes has problems with detecting tests that are defined in abstract base classes but inherited higher in the inheritance hierarchy
Sergey Prytkov
@Rattenkrieg
Dec 11 2016 18:44
Seems it's related with xunit
Sergey Prytkov
@Rattenkrieg
Dec 11 2016 19:20
that was r# issue, VS test explorer works fine