Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 02:22
    kimbyungeun opened #4098
  • Dec 15 19:47

    Aaronontheweb on dev

    TypeExtensions.TypeQualifiedNam… (compare)

  • Dec 15 19:47
    Aaronontheweb closed #4071
  • Dec 15 19:47
    Aaronontheweb closed #3767
  • Dec 15 19:47
    Aaronontheweb labeled #3767
  • Dec 15 19:47
    Aaronontheweb labeled #3767
  • Dec 15 19:47
    Aaronontheweb milestoned #3767
  • Dec 15 19:44
    Aaronontheweb labeled #4097
  • Dec 15 19:44
    Aaronontheweb milestoned #4097
  • Dec 15 13:23
    Aaronontheweb commented #4096
  • Dec 15 13:22
    Aaronontheweb commented #4093
  • Dec 15 13:16
    ismaelhamed commented #4093
  • Dec 15 13:04
    ismaelhamed edited #4097
  • Dec 15 13:04
    ismaelhamed opened #4097
  • Dec 15 12:50
    ismaelhamed commented #4096
  • Dec 15 12:48
    ismaelhamed commented #4096
  • Dec 15 12:05
    Aaronontheweb commented #4096
  • Dec 15 11:43
    ismaelhamed commented #4096
  • Dec 14 19:13
    hwanders commented #4096
  • Dec 14 13:05
    IgorFedchenko commented #4085
Aaron Stannard
@Aaronontheweb
didn't shut down in time
bool == true if it did
Christian Duhard
@cduhard
so its still running if it's false?
Aaron Stannard
@Aaronontheweb
and after we merge akkadotnet/akka.net#1765 all children will have been terminated also
like, guaranteed to have been stopped
correct
still running if false
when PoisonPill is sent, the actor must process all previous messages in its inbox first
before it can shut down
you can customize the shutdown message on GracefulStop too - there's an overload that supports that
so it can be something user-defined potentially
Christian Duhard
@cduhard
yeah, i've been using that
Aaron Stannard
@Aaronontheweb
just know that your message will also be user-defined, so it'll have the same behavior as PoisonPill in terms of processing order
if there's a big backlog of messages sitting in front of it
Christian Duhard
@cduhard
yep
Aaron Stannard
@Aaronontheweb
then the likelihood of a timeout will be higher
Christian Duhard
@cduhard
this graceful shutdown is a lot harder than I anticipated
Aaron Stannard
@Aaronontheweb
what's the issue exactly?
Christian Duhard
@cduhard
coordinating everything
Aaron Stannard
@Aaronontheweb
one pattern I've used
and we use this inside the Remoting class for doing a simultaneous shutdown of all transports at once
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