Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 14 19:13
    hwanders commented #4096
  • Dec 14 13:05
    IgorFedchenko commented #4085
  • Dec 14 03:08
    hhko commented #4094
  • Dec 13 21:37
    Aaronontheweb commented #4085
  • Dec 13 20:28
    IgorFedchenko commented #4085
  • Dec 13 20:27
    IgorFedchenko commented #4085
  • Dec 13 15:38
    Aaronontheweb labeled #4096
  • Dec 13 15:38
    Aaronontheweb milestoned #4096
  • Dec 13 15:38
    Aaronontheweb labeled #4096
  • Dec 13 15:38
    Aaronontheweb opened #4096
  • Dec 13 10:41
    peirens-bart opened #4095
  • Dec 13 08:37
    Aaronontheweb synchronize #4071
  • Dec 13 08:13
    jiyeongj opened #4094
  • Dec 12 15:42
    Aaronontheweb synchronize #4086
  • Dec 12 15:42
    Aaronontheweb closed #4083
  • Dec 12 15:42

    Aaronontheweb on dev

    Fix #4083 - Endpoint receive bu… (compare)

  • Dec 12 15:42
    Aaronontheweb closed #4089
  • Dec 12 15:42
    Aaronontheweb labeled #4093
  • Dec 12 15:42
    Aaronontheweb labeled #4093
  • Dec 12 15:42
    Aaronontheweb labeled #4093
Aaron Stannard
@Aaronontheweb
is I'll build a list of IActorRefs that need to be shutdown
call graceful stop on all of them and build a Task<bool> []
Christian Duhard
@cduhard
my persistent actors need to passivate before I can shutdown a bunch of supporting actors
Aaron Stannard
@Aaronontheweb
then I'll call Task.WhenAll and log a warning if not all of those actors shutdown
ah, got it
yeah, it's tricky
Christian Duhard
@cduhard
i also have a tricky saga type thing in my persistent actors
Christian Duhard
@cduhard
                    var m = message as Shutdown;
                    while (Context.GetChildren().Any(x => x.GetType() == typeof (Account)))
                    {
                        Thread.Sleep(500);
                    }
that seems pretty ugly
Account is the persistent actor type
Bartosz Sypytkowski
@Horusiath
@cduhard belive me, you never want thread blocking in your actors logic. Like NEVER
Christian Duhard
@cduhard
i was more demoing the line of thinking. i have never ran that code
@Horusiath baby kittens are safe
Pavel Knorr
@knorrus
Hi guys! Observing strange issue with Akka persitence, my configuration looks like:
Akka.Persistence 1.0.6.17-beta
Akka.Persistence.PostgreSql 1.0.5.2-beta
In code I have following:
https://gist.github.com/knorrus/c2575fd893f6432d2ee15e2b1750b3b2
Shortly when sending something to journal everything is ok, but during recover, Inner field of de-serialized object is always null
Is there is a know issue?
Bartosz Sypytkowski
@Horusiath
@knorrus this is problem of:
  1. Json.NET v7 being unable to correctly serialize/deserialize auto properties initialized with C# 6 syntax
  2. Using JSON.NET at all as the default serializer for persistence ;)
Christian Duhard
@cduhard
are there other good options for json?
Pavel Knorr
@knorrus
@Horusiath I'm using Newtonsoft.Json 8.0.2
Bartosz Sypytkowski
@Horusiath
json.net v8 has fixed this issue, but you shouldn't relly on the default akka serializer for persistence - it was not created for that
@knorrus try public UserFile UserFile { get; private set; } to verify
Christian Duhard
@cduhard
@Horusiath what would you recommend to accomplish what my terrible thread.sleep example does?
Pavel Knorr
@knorrus
@Horusiath YOU SAVE MY DAY!
with private setter it works
Bartosz Sypytkowski
@Horusiath
@cduhard first you'd need a good way to recognize children of type Account - potentially you could use actor name for that. Then either send the account shutdown message to all children (and make only account able to handle it) or use selection to filter account children and send shutdown to them
Pavel Knorr
@knorrus
@Horusiath Which serializer should I use for persistence? Akka.Persistence comes with Json.Net by default
Bartosz Sypytkowski
@Horusiath
with account children recognized by name, you could easily count them and wait until all of them are dead
Christian Duhard
@cduhard
@Horusiath They already passivate on their own
@Horusiath I just need a way to wait until they are all terminated before starting shutdown of supporting actors and routers
Bartosz Sypytkowski
@Horusiath
@knorrus the major problem with the default serializer is that it may (and will be) changed in the future, while your persisted events format won't. You can always use your own serializer - depending on who you'll ask, there will be different responses. My favourite are schema-defined ones, like proto buf, flat buffers or MS Bond
@cduhard it's still better to do so asynchronously
Christian Duhard
@cduhard
@Horusiath i understand. How to do it async is the part I am having some trouble with. I was hoping to use built in mechanism rather that add a bunch of new message flow
Bartosz Sypytkowski
@Horusiath
@cduhard so you want to stop a parent once all of it's children of specific type will answer to stop request?
to11mtm
@to11mtm
@Horusiath : Wasn't the expectation that things would be moving to 'Wire'? Or has that changed?
Bartosz Sypytkowski
@Horusiath
@to11mtm yes, that's the plan
Christian Duhard
@cduhard
@Horusiath The AggregateCoordinator maintains many worker routers that are used by th persistent actors. They can't be stopped until all are passivated
to11mtm
@to11mtm
Would that be a fairly safe way to go as far as if our team was planning on setting up persistence now?
Christian Duhard
@cduhard
@Horusiath i need to order the shutdown -> PersistentActors -> All Other Children (can be in parallel)
i suppose I could start a timer when the Coordinator receives the Shutdown which is what the silly thread.sleep us trying to accomplish
Become(ShuttingDown) -> fire up timer, handle the timer message -> check for PersistentActors status, then shutdown remaining worker children
Bartosz Sypytkowski
@Horusiath
@to11mtm in general you should never allow third party library tell you what format it will use to store your data. What if something changes or you'll need to migrate your data to another solution? You should either specify message format by yourself or have some migration path for it - if I'm right after 1.5 we'll switch to Wire, but still you'll be able to use json.net serializer as an alternative, you'll just need to specify it explicitly. Also we'll probably provide some tips about how to write format migration scenarios.
Christian Duhard
@cduhard
i think that will work. see any flaws?
Bartosz Sypytkowski
@Horusiath
@cduhard what do you need timer for?
Christian Duhard
@cduhard
to check for non-terminated persistent actors
i can't complete the shutdown until they are all passivated
Bartosz Sypytkowski
@Horusiath
this is something, you should be able to use poisonpill + terminated watch guard for
Christian Duhard
@cduhard
i don't see how
an external shutdown gets triggered, Coordinator receives and waits for passivation of all PA children. once they are all terminated shutdown of supporting worker children can commence
its the waiting part that requires the timer
i can't use a poisonpill because I can't shutdown a PA that way
there are non-persistent sagas in progress
so i can just wait for all to passivate