diff --git a/src/Proto.Actor/Context/SystemContext.cs b/src/Proto.Actor/Context/SystemContext.cs index 467de771df..58f693312e 100644 --- a/src/Proto.Actor/Context/SystemContext.cs +++ b/src/Proto.Actor/Context/SystemContext.cs @@ -14,6 +14,12 @@ public static class SystemContext public static PID SpawnNamedSystem(this RootContext self, Props props, string name) { + if (!name.StartsWith("$")) + { + Logger.LogError("SystemContext Failed to spawn system actor {Name}", name); + throw new ArgumentException("System actor names must start with $", nameof(name)); + } + try { var parent = props.GuardianStrategy is not null diff --git a/tests/Proto.Cluster.Tests/PubSubTests.cs b/tests/Proto.Cluster.Tests/PubSubTests.cs index 34828cc1d3..6285729481 100644 --- a/tests/Proto.Cluster.Tests/PubSubTests.cs +++ b/tests/Proto.Cluster.Tests/PubSubTests.cs @@ -264,7 +264,6 @@ async Task Receive(IContext context) Deliveries.Add(new Delivery(context.ClusterIdentity()!.Identity, msg.Data)); context.Respond(new Response()); break; - case Subscribe msg: await context.Cluster().Subscribe(msg.Topic, context.ClusterIdentity()!); context.Respond(new Response());