Skip to content

Commit

Permalink
Merge pull request #708 from stefansedich/dev
Browse files Browse the repository at this point in the history
Change ordering within ActorSelection to fix issue where /foo paths were...
  • Loading branch information
Aaronontheweb committed Mar 3, 2015
2 parents b319b3c + 0e1c2cd commit 92e7844
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/core/Akka/Actor/ActorRefFactoryShared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,30 @@ public static ActorSelection ActorSelection(ActorPath actorPath, ActorSystem sys
public static ActorSelection ActorSelection(string path, ActorSystem system, ActorRef lookupRoot)
{
var provider = ((ActorSystemImpl)system).Provider;
if(Uri.IsWellFormedUriString(path, UriKind.Absolute))
{
ActorPath actorPath;
if(!ActorPath.TryParse(path, out actorPath))
return new ActorSelection(provider.DeadLetters, "");

var actorRef = provider.RootGuardianAt(actorPath.Address);
return new ActorSelection(actorRef, actorPath.Elements);
}
//no path given
if(string.IsNullOrEmpty(path))
if (string.IsNullOrEmpty(path))
{
return new ActorSelection(system.DeadLetters, "");
}

//absolute path
var elements = path.Split('/');
if(elements[0] == "")
if (elements[0] == "")
{
return new ActorSelection(provider.RootGuardian, elements.Skip(1));
}

if(Uri.IsWellFormedUriString(path, UriKind.Absolute))
{
ActorPath actorPath;
if(!ActorPath.TryParse(path, out actorPath))
return new ActorSelection(provider.DeadLetters, "");

var actorRef = provider.RootGuardianAt(actorPath.Address);
return new ActorSelection(actorRef, actorPath.Elements);
}

return new ActorSelection(lookupRoot, path);
}
}
Expand Down

2 comments on commit 92e7844

@Petabridge-CI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Akka.NET :: Akka.NET PR Build Build 97 is now running

@Petabridge-CI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity Akka.NET :: Akka.NET PR Build Build 97 outcome was FAILURE
Summary: System.Exception: xUnit failed for the following assemblies: D:\BuildAgent\work\49b164d63843fb4\src\core\Akka.Persistence.Tests\bin\Release\Akka.Persistence.Tests.dll, D:\BuildAgent\work\49b164d63843fb4\src\core\Akka.Remote.Tests\bin\Release\Akka.Rem... Build time: 00:08:33

Failed tests

Akka.Persistence.Tests.dll: Akka.Persistence.Tests.SnapshotSpec.PersistentActor_should_recover_state_starting_from_the_most_recent_snapshot_matching_criteria: <no details avaliable>

Akka.Remote.Tests.dll: Akka.Tests.dll: Akka.Tests.Routing.TailChoppingSpec.Tail_chopping_router_must_throw_exception_if_no_result_will_arrive_within_the_given_time: <no details avaliable>

Please sign in to comment.