-
-
Notifications
You must be signed in to change notification settings - Fork 294
Closed
Labels
Description
Summary
Calls to Spawn on ConsistentHashPool props hang if:
- The underlying routee actor props are acquired through dependency injection, and
- The underlying routee type is not properly registered with the DI container.
The expected behavior would be an exception such as: System.InvalidOperationException: No service for type 'MyActor' has been registered.
How to reproduce the issue
Create a plain vanilla ASP NET Core Web App project with the following code:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSingleton(provider => new ActorSystem().WithServiceProvider(provider));
// builder.Services.AddTransient<MyActor>(); <-- commenting this out makes the spawn hang
var app = builder.Build();
var actorSystem = app.Services.GetService<ActorSystem>();
var optionProps = actorSystem.DI().PropsFor<MyActor>();
var poolProps = actorSystem.Root.NewConsistentHashPool(optionProps, 2);
var poolId = actorSystem.Root.Spawn(poolProps); // <-- this is the call that hangs
app.MapGet("/", () => "Hello World!");
actorSystem.Root.Send(poolId, "hello");
app.Run();Reactions are currently unavailable