Giter Club home page Giter Club logo

Comments (7)

Aaronontheweb avatar Aaronontheweb commented on June 13, 2024

@fscavo thanks! I'll look into this.

from phobos-issues.

Aaronontheweb avatar Aaronontheweb commented on June 13, 2024

I wasn't able to reproduce the issue using any permutations of this:

/// <summary>
/// https://github.com/petabridge/phobos-issues/issues/27
/// </summary>
[Fact]
public void Bug27ReproductionSpec()
{
    var actor = Sys.ActorOf(act =>
    {
        act.OnPreStart = context =>
        {
            var defaultSettings = PhobosSettings.For(context.System).ActorSettings.WithTracing(false);
            TestActor.Tell(defaultSettings);
        };
    });

    var settings = ExpectMsg<PhobosActorSettings>();
    settings.Trace.Should().BeFalse();
}

But I believe your error is a configuration problem - it looks like Phobos isn't being loaded, that's why it can't find the IPhobosActorRefProvider. Could you send us a small example of what your ActorSystem configuration looks like? You can post it here or your can send it to us privately via https://sdkbin.com/publisher/petabridge/products/phobos/contact

from phobos-issues.

fscavo avatar fscavo commented on June 13, 2024

This is the phobos configuration used during the creation of ActorSystem

var bootstrap = BootstrapSetup.Create().WithConfig(config);
if (akkaSettings.Phobos.Enabled)
{
    bootstrap.WithActorRefProvider(akkaSettings.EnableCluster ? PhobosProviderSelection.Cluster : PhobosProviderSelection.Local);
}

var finalBootstrap = PhobosSetup.Create(
                    new PhobosConfigBuilder()
                        .WithMetrics(m => m.SetMetricsRoot(metrics))
                        .WithTracing(t =>
                        {
                            t.SetTracer(tracer);
                            t.AddMessageFilter(f =>
                            {
                                var isExcludedMessage = f switch
                                {
                                    Akka.Event.Debug => true,
                                    Akka.Event.Info => true,
                                    ReceiveTimeout => true,
                                    MetricsActor.SendMetrics => true,
                                    MetricsActor.Histogram => true,
                                    MetricsActor.Counter => true,
                                    _ => false
                                };

                                if (isExcludedMessage)
                                {
                                    return false;
                                }

                                return f.GetType().FullName switch
                                {
                                    // Don't include these messages
                                    "Akka.Actor.FSMBase+Timer" => false,
                                    "Akka.Cluster.Tools.PublishSubscribe.Internal.GossipTick" => false,
                                    "Akka.Cluster.Tools.PublishSubscribe.Internal.Status" => false,
                                    "Akka.Actor.Scheduler.TimerScheduler+TimerMsg" => false,
                                    "Akka.Cluster.Sharding.Shard+PassivateIdleTick" => false,
                                    "Akka.Cluster.Sharding.RebalanceTick" => false,
                                    _ => true
                                };
                            });
                        }))
                .WithSetup(bootstrap)
                .And(DependencyResolverSetup.Create(serviceProvider));

from phobos-issues.

Aaronontheweb avatar Aaronontheweb commented on June 13, 2024

@fscavo try changing this line:

bootstrap.WithActorRefProvider(akkaSettings.EnableCluster ? PhobosProviderSelection.Cluster : PhobosProviderSelection.Local);

To

bootstrap = bootstrap.WithActorRefProvider(akkaSettings.EnableCluster ? PhobosProviderSelection.Cluster : PhobosProviderSelection.Local);

That should resolve your issue - reason I bring this up is because BootstrapSetup is immutable:

https://github.com/akkadotnet/akka.net/blob/2715c36ee20640ad343ffd02a73fbce0d5cf9f0e/src/core/Akka/Actor/ActorSystem.cs#L137-L150

from phobos-issues.

Aaronontheweb avatar Aaronontheweb commented on June 13, 2024

@fscavo did you get a chance to try my suggestion from earlier?

from phobos-issues.

fscavo avatar fscavo commented on June 13, 2024

@fscavo did you get a chance to try my suggestion from earlier?

Sorry for the late response @Aaronontheweb
Yes I did and it worked like a charm. Thanks a a lot :)

from phobos-issues.

Aaronontheweb avatar Aaronontheweb commented on June 13, 2024

Glad to hear it!

from phobos-issues.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.