Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 13 14:40
    cptjazz synchronize #3974
  • Oct 13 14:07
    cptjazz opened #3974
  • Oct 13 08:30
    ismaelhamed commented #3937
  • Oct 12 15:50
    IrvinDominin opened #127
  • Oct 11 18:21
    Aaronontheweb commented #3973
  • Oct 11 18:20
    Aaronontheweb commented #3937
  • Oct 11 18:16
    Zetanova commented #3937
  • Oct 11 18:11
    Zetanova commented #3937
  • Oct 11 15:09
    Aaronontheweb commented #3937
  • Oct 11 15:08
    Aaronontheweb commented #3937
  • Oct 11 14:36
    Aaronontheweb commented #3973
  • Oct 11 01:00
    Horusiath commented #3057
  • Oct 10 20:02
    IgorFedchenko synchronize #3973
  • Oct 10 19:59
    IgorFedchenko synchronize #3973
  • Oct 10 19:58
    IgorFedchenko commented #3973
  • Oct 10 19:53
    IgorFedchenko opened #3973
  • Oct 10 14:04
    stijnherreman commented #3057
  • Oct 10 13:54
    Aaronontheweb commented #3970
  • Oct 10 13:54
    Aaronontheweb synchronize #3970
  • Oct 10 10:10
    Zetanova commented #3937
Christian Duhard
@cduhard
i guess this is more about my shitty async skills than anythig
I assume sending a poisonPill just effects that actor and not it's watched children
Aaron Stannard
@Aaronontheweb
@alexvaluyskiy that's the goal
Christian Duhard
@cduhard
@Aaronontheweb so the bool returned from GracefulStop just tells me if the stop was actually graceful and didn't time out?
Aaron Stannard
@Aaronontheweb
bool == false if it timed out
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