Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 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
  • Dec 12 15:42
    Aaronontheweb opened #4093
  • Dec 12 14:20
    Aaronontheweb commented #4092
  • Dec 12 14:14
    Aaronontheweb labeled #4089
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
if I had your cool persistent sagas in your new cluster sharding sample app, I could just poisonpill the lot and move on
Christian Duhard
@cduhard
the current passivation timer waits for those sagas to play out, e.g skips passivation if there are any in progress
Bartosz Sypytkowski
@Horusiath
then you can create your custom PoisonPill equivalent, that can be rejected or delayed due to saga being in progress
Christian Duhard
@cduhard
but then I still have to wait
I don't need to build that because I can just wait for them to passivate. there are no new messages coming in. the shutdown has cut that off further up the hierarchy
Bartosz Sypytkowski
@Horusiath
you can wait for termination
Christian Duhard
@cduhard
yes, I need to know when all are terminated
so i can move forward
a timer is just as easy as trying to keep track of what's alive etc
not as precise, but far less complex
if i were to cluster & shard this I would do this in a more robust way
am I making sense?
Bartosz Sypytkowski
@Horusiath
why you thing that handling Terminated is more complex?
Christian Duhard
@cduhard
there is a disconnect here
i need to know when all of them are terminated
i can't do anything until that happems
*happens
they terminate without the app being in shutdown
Bartosz Sypytkowski
@Horusiath
...
  // normal receive
  message.Match()
  .With<Shutdown>(shutdown =>{
    var accounts = Context.GetChildren().Select(aref => aref.Path.Name.Contains("account")).ToArray();
    foreach(var account in accounts) account.Tell(shutdown);
    Become(WaitingForTermination(accounts.Length))
  });
}

public Receive WaitingForTermination(int counter) {
  var remaining = counter;
  return message => message.Match()
    .With<Terminated>(terminated => {
        if(terminated.ActorRef.Path.Name.Contains("account"))
          remaining--;
        if(remaining == 0)
          AllAccountsTerminated();
    })
    .WasHandled;
}
Christian Duhard
@cduhard
yeah, we were almost identical except I would just poll which is shite, but i was ok with it. My solution requires no changes to the Persistent actor with the down side of a timer