by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 14 23:48
    dependabot-preview[bot] synchronize #4337
  • Aug 14 23:48

    dependabot-preview[bot] on nuget

    Bump FSharp.Quotations.Evaluato… (compare)

  • Aug 14 23:48
    dependabot-preview[bot] edited #4337
  • Aug 14 23:46
    dependabot-preview[bot] edited #4337
  • Aug 14 23:45

    Aaronontheweb on nuget

    (compare)

  • Aug 14 23:45

    Aaronontheweb on dev

    Bump LightningDB from 0.12.0 to… (compare)

  • Aug 14 23:45
    Aaronontheweb closed #4535
  • Aug 14 19:47
    Arkatufus synchronize #4535
  • Aug 14 19:47

    Arkatufus on nuget

    Enhance OpenCircuitException er… Bump Microsoft.NET.Test.Sdk fro… Remove hanging "and" in doc ben… and 3 more (compare)

  • Aug 14 19:45
    Arkatufus synchronize #4535
  • Aug 14 19:45

    Arkatufus on nuget

    Adapt to changes in LightningDB… (compare)

  • Aug 13 06:31
    dependabot-preview[bot] labeled #166
  • Aug 13 06:31
    dependabot-preview[bot] opened #166
  • Aug 13 06:31

    dependabot-preview[bot] on nuget

    Bump Docker.DotNet from 3.125.2… (compare)

  • Aug 12 17:44

    dependabot-preview[bot] on nuget

    (compare)

  • Aug 12 17:44

    dependabot-preview[bot] on dev

    Bump Microsoft.NET.Test.Sdk fro… (compare)

  • Aug 12 17:44
    dependabot-preview[bot] closed #164
  • Aug 12 17:44
    Aaronontheweb commented #164
  • Aug 12 17:24
    dependabot-preview[bot] synchronize #164
  • Aug 12 17:24

    dependabot-preview[bot] on nuget

    Bump Microsoft.NET.Test.Sdk fro… (compare)

Christian Duhard
@cduhard
are there any examples on how to use GracefulStop correctly?
Aaron Stannard
@Aaronontheweb
@cduhard if you PoisonPill the router the router dies
and so do all of its routees
if it's a pool router
Christian Duhard
@cduhard
k it is
Aaron Stannard
@Aaronontheweb
for using GracefulStop
how that works by default is it PoisonPill's the target actor
Christian Duhard
@cduhard
@Aaronontheweb i am mostly not sure what to do with the Tasks if I have numerous children to stop
Aaron Stannard
@Aaronontheweb
and you the Task<bool> returns true if the temporary actor created by the GracefulStop call, kind of like the temporary actors created by Ask, gets a Terminated message
Christian Duhard
@cduhard
say for instance I have
Actor2.GracefulStop(TimeSpan.FromSeconds(10));
Actor3.GracefulStop(TimeSpan.FromSeconds(10), new Shutdown());
when all gracefulstop Tasks are complete I need to send a Passivate type message
i guess this is more about my shitty async skills than anythig
Christian Duhard
@cduhard
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