These are chat archives for akkadotnet/akka.net

20th
Jul 2016
to11mtm
@to11mtm
Jul 20 2016 00:06 UTC
alas, oracle world; I have to OVERRIDE ALL THE STRINGS to get parameters in
Aaron Stannard
@Aaronontheweb
Jul 20 2016 00:20 UTC
@to11mtm check out the MySQL repo - just updated it to 1.1.1 today
@Horusiath @Silv3rcircl3 so I just rewrote WebCrawler to use 1.1.1 for Clustering but more importantly, I rewrote the Crawler node to use Akka.Streams to actually run the download
I'm going to stage a PR in a bit where with those changes - would one of you mind taking a look at the way I used Streams and tell me I did it wrong / could do it better?
everything worked on the first try
but the DSL for Streams was a bit tough to wrap my head around at first - couldn't tell what the point of the TMaterializer was
either way Akka.Streams is solving an important problem in this sample now
which is throttling the number of concurrent requests for downloads
to11mtm
@to11mtm
Jul 20 2016 00:29 UTC
@Aaronontheweb ty! Alas, it gets away with inheriting from the abstract, so I still get to rewrite a bunch of strings (Also... I am dead in the water for implementing hints. HintToSql is a private method, so I can't override to fix the strings it throws in)
should I keep using Self.Tell(PoisonPill.Instance) or is it better to use Self.GracefulStop(...)?
Aaron Stannard
@Aaronontheweb
Jul 20 2016 01:14 UTC
all graceful stop does is the same thing, but returns a task confirming that you've died
@Silv3rcircl3 @Horusiath I can't figure out how to design a graph that looks like this with Akka.Streams
blob
I've been using the Flow DSL for this so far
just started looking at the GraphDsl
is that the right tool for this job?
I want to take the output from Flow2 and send it to two different sinks
I guess I could just treat what happens after Sink2 receives the message as a separate, detatched substream
what would you recommend?
to11mtm @to11mtm sighs at the resulting repeating Implementation hackery, shrugs.
Marc Piechura
@marcpiechura
Jul 20 2016 05:40 UTC
@Aaronontheweb yup, GraphDsl with a Broadcast stage should do the job
Arsene T. Gandote
@Tochemey
Jul 20 2016 06:51 UTC
Hello please can someone explain to me the difference between Journal ans Snapshot in Akka.Persistence and when to use each one of them. I see that @Horusiath has written a well oiled blog about "Create your own Akka Persistence plugin". However I could not make the difference btw both. Thanks
Vagif Abilov
@object
Jul 20 2016 06:53 UTC
@Tochemey Snapshots are mostly for optimization, conceptually nothing changes if you don't use them at all, then the state of a persistent actor will always be re-created from journal events (which is in many cases sufficient).
I remember I myself was misuing snapshots by working with them directly (without even creating journal events). @Horusiath explained me that this was wrong and could in fact lead to erratic behavior. The picture becomes more clear if you think of events and snapshots in terms of event sourcing.
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 06:55 UTC
@Tochemey Journal stores changes (diffs) of an actor's state - so things like updated values of particular fields, but not the whole state. When actor resurrects it will recover from a stream of events to construct the complete state. Snapshot is a whole state of an actor, that can be loaded at once. It's used for optimization, so in case when you have a long stream of events to recover state from, you can load a snapshot instead and recover just from the latests X events, that occured since that snapshot has been made.
Arsene T. Gandote
@Tochemey
Jul 20 2016 07:05 UTC
So for instance in a case I want to persist messages not the Actor's state can I still use Akka.Persistence API?
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 07:07 UTC
yes, but it's more like special use case (see at-least-once delivery actors)
Arsene T. Gandote
@Tochemey
Jul 20 2016 07:19 UTC
So in that case what do you guys suggest to me since I want to persist some message?
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 07:21 UTC
you could use message queue, which is build specifically for that purpose eg.: RabbitMQ, MSMQ, Azure Service Bus.
Arsene T. Gandote
@Tochemey
Jul 20 2016 07:23 UTC
Ok
Peter Bergman
@peter-bannerflow
Jul 20 2016 07:31 UTC

Bumping this question since its still unclear to me, I undestand what blocking is just not how it comes into play in the context of the mailbox. Which component is being blocked in this case?

Reading the UnboundedPriorityMailbox, what does it mean that this mailbox is blocking? http://getakka.net/docs/working-with-actors/Mailbox#unboundedprioritymailbox

Bartosz Sypytkowski
@Horusiath
Jul 20 2016 07:33 UTC
@peter-bannerflow didn't looked into implementation, but none of the mailboxes ever required blocking threads in the main hot path, if that is your concern ;)
Peter Bergman
@peter-bannerflow
Jul 20 2016 07:34 UTC
Ok, hmm yeah I was wondering since the docs say "the unbounded mailbox priority mailbox is blocking mailbox that allows message prioritization"
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 07:35 UTC
yes, maybe this part of the docs would need some more precise description
Peter Bergman
@peter-bannerflow
Jul 20 2016 07:39 UTC
I see, beacuse I was thinking about performance difference between the UnboundedMailbox and the UnboundedPriorityMailbox. Besides the performance penalty of calculating the prio for each message, the UnboundedPriorityMailbox should behave as the UnboundedMailbox ?
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 07:40 UTC
in normal conditions blocking means, that queue will be blocked, once it's maximum capacity will be reached, but that doesn't have a lot of sense in case of unbounded mailboxes
Peter Bergman
@peter-bannerflow
Jul 20 2016 07:41 UTC
Yeah ok, so blocking in this context would actually refer to bounded mailboxes I guess?
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 07:45 UTC
I think so
Ricky Blankenaufulland
@ZoolWay
Jul 20 2016 08:19 UTC
How do I configure child routers? I am creating like always, Context.ActorOf(Props.Create(() => new Actor()).WithRouter(FromConfig.Instance), "a") and my akka.hocon serves this deployment entry:
            /parent/a {
                router = round-robin-pool
                nr-of-instances = 1
            }
But I get Configuration problem while creating [akka://cluster/user/parent/a] with router dispatcher [akka.actor.default-dispatcher] and mailbox and routee dispatcher [akka.actor.default-dispatcher] and mailbox []
Davydov Denis
@Inkp
Jul 20 2016 08:22 UTC
Hello. After our recent application profiling I found out Helios.Concurrency.DedicatedThreadPool+PoolWorker.ctor>b__a() is in the top of the call chart with 10%(!!) of all calls . Can you give me any clue, why that can happen?
Ricky Blankenaufulland
@ZoolWay
Jul 20 2016 08:56 UTC
Nevermind... the changed hocon configuration was not copied to the output directory. Still messing with the .NET core project setups.
ollivogel
@ollivogel
Jul 20 2016 09:34 UTC
Hi, everybody. How can I delete all snapshots from an persistenceActor?
Bart de Boer
@boekabart
Jul 20 2016 09:55 UTC
@ollivogel directly in your Db is one option...
ollivogel
@ollivogel
Jul 20 2016 10:19 UTC
@boekabart Isn't there a higher level api access?
Sergey Kostrukov
@kostrse
Jul 20 2016 10:49 UTC
Hi All. Does anyone have real experience of running Akka in Service Fabric (e.g. StatelessService)?
Peter Bergman
@peter-bannerflow
Jul 20 2016 11:18 UTC
@kostrse I know some people are looking into it. I gave it a shot some weeks ago but abandoned it since I couldn't get my cluster stable enough
Sergey Kostrukov
@kostrse
Jul 20 2016 11:19 UTC
problems with left members?
Peter Bergman
@peter-bannerflow
Jul 20 2016 11:20 UTC
Yes and also I think I had issues with connectivity between the different nodes in my Akka.Cluster when it was replicated on each node in the SF cluster
Sergey Kostrukov
@kostrse
Jul 20 2016 11:23 UTC
Curious, how did you wrap the AkkaSystem into Service Fabric service? into CommunicationListener, or into StatelessService's OnOpenAsync/OnCloseAsync?
Trying different approaches myself right now..
Peter Bergman
@peter-bannerflow
Jul 20 2016 11:26 UTC
I wrapped my actor system in stateless services, did most of the setup in some of the application lifecycle methods. Tried running lighthouse inside SF as well first. Then I used the property manager to store the IPs of the lighthouse nodes. I never did anything with communication listeners, perhaps thats something that needs to be setup correctly in order for the services to expose their Akka.Remote ports to enable communication between nodes..
Sergey Kostrukov
@kostrse
Jul 20 2016 11:31 UTC
I have a crazy idea (not proved yet)... start Akka System standalone without cluster join(i.e. not define any seed nodes in config)... and implement a CommunicationListener which has it's own pair of Open/Close methods and does Cluster.Get(akkaSystem).JoinSeeds() and Cluster.Get(akkaSystem).Leave... this will let me ability to report the akka endpoint into Service Fabric Naming Service, get list of seeds dynamically from the same Service Fabric Naming Service (no dedicated seed nodes like Lighthouse - all previously started Akka instances are registered and work as seed nodes)...
I'm not very well familiar with API of Akka Cluster to be sure that this doable...
but in theory it's possible to achieve graceful cluster join / leave without risk of cluster partition (split brain) as long as underlying Service Fabric is not partitioned itself
  • Standalone I mean in StatelessService...
and in CommunicationListener inside of the StatelessServce to join the cluster...
Ricky Blankenaufulland
@ZoolWay
Jul 20 2016 11:37 UTC
@kostrse This is not crazy. I would also not only have previously started instances use as seed nodes but also memorizes those started later because maybe all earlier started nodes get lost and we would not want a cluster split because of that.
Peter Bergman
@peter-bannerflow
Jul 20 2016 11:39 UTC
What about some Akka.Cluster features like cluster aware routers, I guess you would not be able to use those then? Or..?
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 11:40 UTC
@kostrse that's definitelly doable. I know that @mmisztal1980 had some working sample. I've tried make one myself, but haven't time to finish + ServiceFabric is so irritating piece of tech for me.
Ricky Blankenaufulland
@ZoolWay
Jul 20 2016 11:41 UTC
@peter-bannerflow Why not? You assign a cluster router to search its routees on a role, no need for IP/port.
Sergey Kostrukov
@kostrse
Jul 20 2016 11:45 UTC
ok thanks guys... will let you know if I can make anything with it
Weston
@ronnyek
Jul 20 2016 14:15 UTC
I found an older looking page with the target releases... sounds like streams were in beta or in development otherwise... is that correct?
Weston
@ronnyek
Jul 20 2016 14:21 UTC
and does akka streams in akka.net automatically mean reactive streams, or no?
Marc Piechura
@marcpiechura
Jul 20 2016 14:30 UTC
@ronnyek Akka.Streams was release as beta in 1.1 and yes it is a implementation of the reactive streams standard
Weston
@ronnyek
Jul 20 2016 14:33 UTC
bitchin!
Peter Rosconi
@prosconi
Jul 20 2016 15:06 UTC
I need some help on how to shutdown my system gracefully. I am reading in a CSV file and sending messages to a RoundRobinPool router to process the rows. I want to be able to shutdown the system when the processing is done. I tried sending a PoisonPill to the router, but it causes messages to not get processed. All actors are within the same process
Vagif Abilov
@object
Jul 20 2016 15:17 UTC
@prosconi AFAIK you can't just send poison pill to the router actor if you want some routee to handle its messages. But did you try GracefulStop? Also look at this article: https://petabridge.com/blog/how-to-stop-an-actor-akkadotnet/
Aaron Stannard
@Aaronontheweb
Jul 20 2016 15:50 UTC
@kostrse I'm going to be playing with Service Fabric soon myself; getting my Akka.Streams training wheels on first :p
but I know @mmisztal1980 and others have been using it
going to be moving our eCommerce / order fulfillment / BI system onto Akka.Cluster / Service Fabric
Peter Rosconi
@prosconi
Jul 20 2016 17:03 UTC
@object GracefulStop appears to just kill it's children if it is a router, so I tried
router.Tell(new Broadcast(PoisonPill.Instance));
which works. But then I can't tell when everything is completed
Bartosz Sypytkowski
@Horusiath
Jul 20 2016 17:06 UTC
@prosconi for completion you'll need to track the responses - so if you have data you want to partition and send to broadcast, you can store id of each data segment, and once the result of computation comes back, just take it of the collection. Once collection is empty, that means routers have done their job.
in this example refs is basically group of actors created to perform some computation.
Aaron Stannard
@Aaronontheweb
Jul 20 2016 17:18 UTC
ah hell yeah - the Sqlite persistence plugin works great
was able to easily migrate from SqlServer LocalDb to it
including some manual dapper repositories I wrote
ollivogel
@ollivogel
Jul 20 2016 18:13 UTC
Jo Everyone. Is it possible to instruct a persistence Actor to remove all snapshots?
Ivan R. Perez
@irperez
Jul 20 2016 18:18 UTC
@Aaronontheweb a course on Akka Streams sounds appropriate :smile:
ollivogel
@ollivogel
Jul 20 2016 18:28 UTC
@qwoz so far so good. But which criteria is required to delete All snapshots?
@qwoz Cannot find this in the awesome documentation. :)
@ollivogel it should be obvious from https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka.Persistence/SnapshotProtocol.cs#L409 -- with appropriate min/max values, you'll cover everything
I would think even SnapshotSelectionCriteria(long.MaxValue);ought to do nicely.
Aaron Stannard
@Aaronontheweb
Jul 20 2016 19:09 UTC
@irperez heh, definitely going to write a blog post about it
but yeah, there's definitely enough material with Streams to warrant at least 1 course
Aaron Stannard
@Aaronontheweb
Jul 20 2016 23:14 UTC
@garrardkitchen @kostrse @kantora been getting a lot of Mono questions since 1.1 so I put a milestone together for it https://github.com/akkadotnet/akka.net/milestone/10
going to see if we can get our builds to run in parallel on Mono once again
been a while, but @alexvaluyskiy mentioned he was able to get the build suite to run so that gives me confidence that Mono's intermittent issues since the 4.0 release have calmed