These are chat archives for akkadotnet/akka.net

9th
Jun 2015
Chris Martin
@trbngr
Jun 09 2015 00:37
@Horusiath what would be the suggested path to saving persistentView snapshots? Is it safe to hook into AroundPostStop? How about listening to Terminated? Scheduled?
NeoDarque
@NeoDarque
Jun 09 2015 04:54
I wanted to try out Akka.Persistence with SqlServer, but I’m getting an exception when calling SqlServerPersistence.Init(system), file not found for ”Akka.Persistence.Sql.Common”. I’m using version 1.0.2 from NuGet. Is that not ready for consumption yet?
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 06:35
@NeoDarque no, this was just problem with creating nuget package (it's missing one library) - @Aaronontheweb could you update nuget packages for SqlServer and Postgres to include Akka.Persistence.Sql.Common? I didn't touch publishing NuGet packages before.
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 06:50
@trbngr depending on performance costs it may turn out that you don't need snapshotting at all. Scheduled snapshotting is bad IMO, since you either will end making identical snapshots for periods when state didn't change or you'll need some kind of structural equal operator before making a snapshot. In my example I've put a counter which was making a snapshot after X successful events persisted (exact number to be measured) - issue is that if counter itself was not stored, there is possibility that snapshot could be never made for huge X, because after restarting an actor counting would start from the beginning.
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 06:56
and setting a snapshot in PostStop looks good but: 1) if your VM or actor system will crash (i.e. out of memory exception), PostStop won't be called 2) it could cause a "tricky" behavior, because persistent actor won't wait for snapshot store to ACK the snapshot before restarting - in result when recovering it could probably get earlier version of a snapshot than the one it tried to save last time (is is described in #789 and on JVM akka in akka/akka#17139 )
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 08:05
Also @Aaronontheweb @rogeralsing I think we should add UrlEncoder helper for core akka.utils - when working with actors I often see it's necessary to convert actor name into URI-safe version (both Akka.Cluster.Sharding and Akka.Cluster.Tools are doing it quite often), but I don't want to introduce System.Web dependency only for this one reason
ok nvm. Didn't realized System.Uri.EscapeUriString gives similar feature
Marc Piechura
@marcpiechura
Jun 09 2015 08:12
@rogeralsing just want to make sure you doesn't missed my commend on your commit about the readme ;) https://github.com/akkadotnet/akka.net/commit/af23526d4cb6de2155b918b13e47fdcd646b4dc4#commitcomment-11569245
Nikita Tsukanov
@kekekeks
Jun 09 2015 08:35

issue is that if counter itself was not stored, there is possibility that snapshot could be never made for huge X, because after restarting an actor counting would start from the beginning.

Why do you need to store the counter? Actor always has enough information to know how many events it had after the latest snapshot.

Even after restart
It'll get SnapshotOffer and then get events
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 08:44
yes @kekekeks , you're right
Kjellski
@kjellski
Jun 09 2015 08:54
I'm currently trying to stop an ActorSystem that has nothing in it, not even one Actor was created. AwaitTermination still blocks forever, any ideas? In the config I've only one setting: loglevel: DEBUG ... Any hints on this?
Kjellski
@kjellski
Jun 09 2015 09:06
Hmmm, that might actually be a bug: this waits forever too:
var system = ActorSystem.Create("Test");
system.AwaitTermination();
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 09:13
I guess, you've missed system.Shutdown() between these two lines
Kjellski
@kjellski
Jun 09 2015 09:24
@Horusiath aaahh, that is not actually shutting down the system? I was looking at the wrong examples :D sorry! :worried:
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 09:27
np ;)
Kjellski
@kjellski
Jun 09 2015 10:09
Is there a nice trick to debug from one actors Tell call into the receiving actors method?
Like with F11 or so?
Boban
@bobanco
Jun 09 2015 10:10
Is there any work under akka streams?
Ian Barry
@ianbarry
Jun 09 2015 10:12
@kjellski You could try Context.GetLogger().Log(LogLevel.InfoLevel, "Your debug message");
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 10:12
@kjellski not as far as I know - it's a beauty of async operations ;)
@bobanco yes, some works have been started, but first we want to deliver some cluster-based stuff
Boban
@bobanco
Jun 09 2015 10:23
@Horusiath is there any branch where i can check how much of the streams is ported so i can do some porting too?
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 10:27
I've started my implementation in https://github.com/Horusiath/akka.net/tree/akka-streams/src/core/Akka.Streams but there are A LOT of moving parts and many things will have to be changed.
Chris Martin
@trbngr
Jun 09 2015 15:05
@Horusiath @kjellski Thanks for the conversation. It really helped
Aaron Stannard
@Aaronontheweb
Jun 09 2015 17:19
@Horusiath sure thing, I can take care of that
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 18:48
I need to implement range queries on our ImmutableTreeMap... they were saying that shit like that ends with the university :P
Aaron Stannard
@Aaronontheweb
Jun 09 2015 19:07
@Horusiath yeah, our project is one of those ones where you end up having to go back to a lot of academic / low-level stuff that ".NET developers aren't supposed to have to care about"
like data structures, how sockets work, how to implement our own thread pools, etc...
Ivan R. Perez
@irperez
Jun 09 2015 20:07
Is there a really good primer on Akka Sql Persistence? I've seen the online documentation. But something that has some more examples would be nice and explaining the why...
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 20:25
@irperez once you configure which implementation of journal/snapshot store are you using, it's details becomes quite transparent. The most details are available in https://github.com/akkadotnet/akka.net/blob/dev/src/contrib/persistence/Akka.Persistence.SqlServer/README.md
I've ported most of the Akka.Cluster.Tools (6+k LOC). It was a good day :D
Roger Johansson
@rogeralsing
Jun 09 2015 20:39
OMFG
NeoDarque
@NeoDarque
Jun 09 2015 21:10
@Horusiath Ok, thanks. I got SqlServer persistence working when compiling akka.net from source and copying Aka.Persistence.Sql.Common from there.
Anyone know any good material to read how Akka.Persistence (JVM) has been used in real applications? I’m trying to wrap my head around how (and why/when) to use it. I’ve never used EventSourcing before which probably adds to my confusion. :smile:
Bartosz Sypytkowski
@Horusiath
Jun 09 2015 22:24
@NeoDarque I've created an example once, it's not finished, but I think it's good place to start