These are chat archives for akkadotnet/akka.net

8th
Nov 2015
Bartosz Sypytkowski
@Horusiath
Nov 08 2015 07:24
it looks like our multinode test runner swallows stack traces from exceptions
Bartosz Sypytkowski
@Horusiath
Nov 08 2015 07:34
also another question: from where those messages, that test runner shows, are taken from? They are not standard logging bus messages.
Ryan J. Shaw
@ryanjshaw
Nov 08 2015 09:36
does anybody have a simple Akka.Cluster example with Lighthouse running as a seed node A and a message is sent from non-seed node B to non-seed node C?
all the examples I can find are either super simple (subscribing to cluster events) or crazy complex (e.g. the WebCrawler one which is doing remote deployment)
I am getting an error like this: "Message TestRequest from akka://testcluster/user/source_actor to akka://testcluster/user/target_actor was not delivered. 1 dead letters encountered" - I can see Lighthouse has got node B and C on its membership list but just can't seem to send messages across the cluster
Zetanova
@Zetanova
Nov 08 2015 11:26
I am using ActorTaskScheduler to execute some AsyncMethods inside an actor.
Sometimes a thread is blocking at TryExecuteTask(task); Line-64
It is blocked by a RX Subject hosted with TaskPoolScheduler.ScheduleLongRunning();
Its like, it was queued by RX for LongRunning and ended up in the Akka Scheduler.
Its waiting now for new RX Events and this Subject is a Infinite Event Feed.
And so the Actor is not serving message anymore.
Zetanova
@Zetanova
Nov 08 2015 12:01
the LongRunning thread from the RX Subject is created on the first OnNext()
How schould a scheduler behaive on LongRunning? Is this a miss by the AsyncTaskScheduler ?
Zetanova
@Zetanova
Nov 08 2015 12:08
"In practice, our actual implementation in .NET 4 does exactly what you say, using a non-ThreadPool thread to run the Task, but that's an implementation detail, and could change in the future."
"The default TaskScheduler implements LongRunning as I outlined above, but a custom scheduler could do whatever it wanted with the LongRunning hint."
Bartosz Sypytkowski
@Horusiath
Nov 08 2015 13:35
@rogeralsing do you think, we could incorporate delegate serialization in Wire? (I'm not saying doing this for lambdas, but only for delegates)
Natan Vivo
@nvivo
Nov 08 2015 15:27
is it safe to use FutureActorRef directly? Is it considered public or internal api?
Roger Johansson
@rogeralsing
Nov 08 2015 16:29
@Horusiath yes it shouldnt be any problem really
@nvivo its private
Natan Vivo
@nvivo
Nov 08 2015 16:31
@rogeralsing I need a form of "ask" using the event stream. I want to publish a request and wait for the first message to come back. I'm using regular actors now, but I'd like to avoid creating an actor for each request
is there any way to do this currently?
I'm currently trying to copy the code from Ask and implement it directly in my code, trying to see if this works
Roger Johansson
@rogeralsing
Nov 08 2015 16:37
that should be possible, there is no magic in there except for the usual sender stuff, but other than that it should be straightforward
Natan Vivo
@nvivo
Nov 08 2015 16:38
yeah, I'm adding the sender to the message, so I can reply without an implicit sender
ok, I'll keep going and see if it works
thanks
Roger Johansson
@rogeralsing
Nov 08 2015 16:41
@Horusiath is there a specific use case you need it for?
Ryan J. Shaw
@ryanjshaw
Nov 08 2015 16:45
does Akka.Cluster require manual tracking of ClusterEvent.MemberUp messages to correctly figure out when it's possible to communicate with the cluster?
I'm struggling with messages not being delivered to the cluster but even with all debugging options I can find enabled I'm none the wiser
Bartosz Sypytkowski
@Horusiath
Nov 08 2015 17:02
@rogeralsing I haven't got Internet for half of a day, so I've created a seed for akka-typed on C# ;) Many features are already there
but since it works on delegates, it requires to make them serializable
Roger Johansson
@rogeralsing
Nov 08 2015 17:03
but do they do that on jvm too? serialize delegates?
Bartosz Sypytkowski
@Horusiath
Nov 08 2015 17:03
@ryanjshaw basically yes, you should subscribe to cluster events on PreStart.
Ryan J. Shaw
@ryanjshaw
Nov 08 2015 17:18
@Horusiath even though I do that, my messages are not getting delivered to cluster members (I can confirm I'm receiving MemberUp messages for these members). am I incorrect in thinking if node A is lighthouse, node B has a "/user/source_actor" and node C has "/user/target_actor", then from node B doing Context.ActorSelection("/user/target_actor").Tell(new TestMessage()) should be delivered to node C?
Marc Piechura
@marcpiechura
Nov 08 2015 17:39
@rogeralsing anything I can help you with to get a hocon release ready? Would like to remove my local version ;-)
Roger Johansson
@rogeralsing
Nov 08 2015 17:42
@Silv3rcircl3 the main issue with the extracted hocon lib is that we want to keep compatability with existing code, but it should be possible if we just remove the hocon code in akka.net and add a ref to the new lib
the configuration section loaded probably needs to exist in the Akka.net lib still though, as existing code points to the akka.net lib fully qualified assembly name
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="akka"
             type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />     <-- this bit points to akka.net lib
but if that class stays in akka.net, and the rest is in the hocon lib, then everything should be fine I think
Natan Vivo
@nvivo
Nov 08 2015 17:48
@rogeralsing copying the logic from ask worked very well
Roger Johansson
@rogeralsing
Nov 08 2015 17:52
:+1:
that would be an interesting blog post ;) hint hint
Marc Piechura
@marcpiechura
Nov 08 2015 17:54
I see, in my case I want to use hocon without akka, so I would be satisfied if hocon would be released also if akka doesn't use the new lib ;-) but if nobody else is doing it, I could try to replace it inside akka
Natan Vivo
@nvivo
Nov 08 2015 18:00
I really need to create a personal blog, but I'm so lazy :-D
I'll make it a new year resolution
Maxim Salamatko
@maxim-s
Nov 08 2015 18:35
hello, have anybody got problem to run akka.remote.tests in visual studio?
I've got an error "System.IO.FileLoadException: Could not load file or assembly 'xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' "
the same error if to do it by xunit.console.runner
Bartosz Sypytkowski
@Horusiath
Nov 08 2015 19:33
@ryanjshaw don't think about nodes in context of virtual machines. If you want to apply some specific behavior to node, group them by using cluster roles. If I'm right, on MemberUp you receive Member info about new cluster node - this member contains list of roles, that member fulfills. Just check it if is desired one. If so, you may assume that it has particular set of actors working on it and send messages to them.
Bartosz Sypytkowski
@Horusiath
Nov 08 2015 20:52
@Aaronontheweb where do we get akka.net logo for NuGet from? nvm, found it
@maxim-s try to get nuget reference to xUnit test runner
Yin Zhang
@melcloud
Nov 08 2015 21:37
Morning guys. I hope someone can show me how to correctly use the BackOffSupervisor. I set up two actors like following, and expect the FakeActor to be restarted after 10 seconds, but it seems to keep processing it without a backoff.
public class TestActor : ReceiveActor
{
    private IActorRef _child;

    public TestActor()
    {
        Receive<string>(msg =>
        {
            _child.Forward(msg);
        });
    }

    protected override void PreStart()
    {
        var ch = Props.Create(() => new FakeActor(), OneForOneStrategy.StoppingStrategy);
        _child = Context.ActorOf(Props.Create(() => new BackoffSupervisor(ch, null, TimeSpan.FromSeconds(10), TimeSpan.FromMinutes(1), 0.25)));
    }
}

public class FakeActor : ReceiveActor
{
    public FakeActor()
    {
        Receive<string>(msg =>
        {
            FatalError();
        });
    }

    protected override void PostStop()
    {
        Console.WriteLine("Actor is stopped");
    }

    protected override void PreRestart(Exception reason, object message)
    {
        if (message != null)
        {
            Self.Forward(message);
        }

        base.PreRestart(reason, message);
    }

    private void FatalError()
    {
        throw new InvalidOperationException();
    }
}