Skip to content

Commit

Permalink
Change ordering within ActorSelection to fix issue where /foo paths w…
Browse files Browse the repository at this point in the history
…ere not working within mono on linux.
  • Loading branch information
stefansedich committed Mar 3, 2015
1 parent 66e7498 commit 0e1c2cd
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

4 comments on commit 0e1c2cd

@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 95 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 95 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 at Microsoft.FSharp.Core.Operators.FailWith[T](String message) at Fake.XUnitHel... Build time: 00:10:43

Failed tests

Akka.Persistence.Tests.dll: Akka.Persistence.Tests.GuaranteedDeliveryCrashSpec.GuaranteedDelivery_should_not_send_when_actor_crashes: <no details avaliable>

@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 96 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 96 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 at Microsoft.FSharp.Core.Operators.FailWith[T](String message) at Fake.XUnitHel... Build time: 00:09:31

Failed tests

Akka.Persistence.Tests.dll: Akka.Persistence.Tests.PersistentActorSpec.PersistentActor_should_be_able_to_opt_out_from_stashing_messages_until_all_events_has_been_processed: <no details avaliable>

Akka.Persistence.Tests.dll: Akka.Persistence.Tests.GuaranteedDeliveryCrashSpec.GuaranteedDelivery_should_not_send_when_actor_crashes: <no details avaliable>

Please sign in to comment.