Sorry for the delay, Jim, I had hoped that I can reply with a completed fix but 
didn’t get around to it in the end: this is a bug.

Regards,

Roland

12 mar 2014 kl. 05:54 skrev Jim Newsham <[email protected]>:

> 
> 
> On Thursday, March 6, 2014 11:31:35 PM UTC-10, Björn Antonsson wrote:
> Hi Jim,
> 
> On 7 March 2014 at 06:38:47, Jim Newsham ([email protected]) wrote:
> 
>> 
>> Hi Bjorn,
>> 
>> Thanks for your response.  It may be easier to explain by providing some 
>> code as an illustration.  In the following main class, I start up two actor 
>> systems -- system1, and system2 which will deploy actors to system1.  In 
>> test1(), I try to remote deploy two actors with the same path name; this 
>> fails (as expected).  In test2(), I deploy, then stop/restart system2, then 
>> deploy again with the same name.  This works (as expected).  
>> 
>> public class Main {
>>   
>>   public static void main(String... args) throws Exception {
>>     test1();
>>     //test2();
>>   }
>> 
>>   private static void test1() throws Exception {
>>     Config config = ConfigFactory.parseResources(Main.class, "deploy.conf");
>>     Config system1Config = config.getConfig("system1").withFallback(config);
>>     Config system2Config = config.getConfig("system2").withFallback(config);
>>     ActorSystem system1 = ActorSystem.create("system1", system1Config);
>>     int system1Port = system1Config.getInt("akka.remote.netty.tcp.port");
>>     Address system1Address = new Address("akka.tcp", "system1", "127.0.0.1", 
>> system1Port);
>>     
>>     ActorSystem system2 = ActorSystem.create("system2", system2Config);
>>     system2.actorOf(TestActor.props().withDeploy(new Deploy(new 
>> RemoteScope(system1Address))), "test");
>>     system2.actorOf(TestActor.props().withDeploy(new Deploy(new 
>> RemoteScope(system1Address))), "test");
>>   }
>>   
>>   private static void test2() throws Exception {
>>     Config config = ConfigFactory.parseResources(Main.class, "deploy.conf");
>>     Config system1Config = config.getConfig("system1").withFallback(config);
>>     Config system2Config = config.getConfig("system2").withFallback(config);
>>     ActorSystem system1 = ActorSystem.create("system1", system1Config);
>>     int system1Port = system1Config.getInt("akka.remote.netty.tcp.port");
>>     Address system1Address = new Address("akka.tcp", "system1", "127.0.0.1", 
>> system1Port);
>>     
>>     ActorSystem system2 = ActorSystem.create("system2", system2Config);
>>     system2.actorOf(TestActor.props().withDeploy(new Deploy(new 
>> RemoteScope(system1Address))), "test");
>>     Thread.sleep(1000L);
>>     
>>     system2.shutdown();
>>     Thread.sleep(1000L);
>>     system2 = ActorSystem.create("system2", system2Config);
>>     system2.actorOf(TestActor.props().withDeploy(new Deploy(new 
>> RemoteScope(system1Address))), "test");
>>   }
>> 
>> }
>> 
>> However, when I perform essentially test2(), but as two separate processes, 
>> and I kill system2 before redeploying again, I find that I am able to start 
>> up system2 and remote deploy to system1 using the same actor path with no 
>> error.  See System1Main and System2Main in the attached source code.  I am 
>> (1) running System1Main; (2) running System2Main which deploys to system1; 
>> (3) killing the second process; (4) running System2Main again which 
>> re-deploys to system1. The following log output from System1Main shows that 
>> the actor is deployed to the same path twice, and the first instance is 
>> never stopped:
> 
> 
> So the thing here is that you are deploying it twice from two different actor 
> systems who just happen to be have the same name/port (the first system2 and 
> the second system2), but they have different UIDs and are considered 
> different systems by system1. This means that the actor on system1 could be 
> “replaced” with a new actor for a short period until system1 realizes that 
> the old system2 is dead and stops the first actor.
> 
> So does the first remote deployed actor shut down eventually, or do you not 
> see that even if you wait for a while?
> 
> It would be great if you could run your test with debug logging enabled.
> 
> Hi Bjorn,
> 
> Thanks for your response!
> 
> In response to your question, I waited a while (over 5 minutes), and never 
> saw the first remote deployed actor shut down.
> 
> Secondly, I re-ran the test with debug logging enabled, as you suggested.  
> See below.  With debug logging on, I see that as you have said, the second 
> remote-deployed actor replaces the first one.  However, I never see the first 
> actor actually being terminated.
>  
> 2014-03-11 18:21:18,753 [system1-akka.actor.default-dispatcher-4] INFO  
> akka.event.slf4j.Slf4jLogger - Slf4jLogger started
> 2014-03-11 18:21:18,764 [system1-akka.actor.default-dispatcher-4] DEBUG 
> akka.event.EventStream - logger log1-Slf4jLogger started
> 2014-03-11 18:21:18,766 [system1-akka.actor.default-dispatcher-4] DEBUG 
> akka.event.EventStream - Default Loggers started
> 2014-03-11 18:21:18,788 [system1-akka.actor.default-dispatcher-4] INFO  
> Remoting - Starting remoting
> 2014-03-11 18:21:18,938 [system1-akka.actor.default-dispatcher-4] INFO  
> Remoting - Remoting started; listening on addresses 
> :[akka.tcp://[email protected]:2551]
> 2014-03-11 18:21:18,939 [system1-akka.actor.default-dispatcher-4] INFO  
> Remoting - Remoting now listens on addresses: 
> [akka.tcp://[email protected]:2551]
> 2014-03-11 18:21:26,128 [system1-akka.actor.default-dispatcher-3] DEBUG 
> Remoting - Associated [akka.tcp://[email protected]:2551] <- 
> [akka.tcp://[email protected]:2552]
> 2014-03-11 18:21:26,217 [system1-akka.actor.default-dispatcher-3] DEBUG 
> LocalActorRefProvider(akka://system1) - Received command 
> [DaemonMsgCreate(Props(Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka.tcp://[email protected]:2551),,),class
>  
> test.akka.deploy.TestActor,Vector()),Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka.tcp://[email protected]:2551),,),akka.tcp://[email protected]:2551/remote/akka.tcp/[email protected]:2552/user/test#2077035188,Actor[akka.tcp://[email protected]:2552/user])]
>  to RemoteSystemDaemon on [akka://system1]
> 2014-03-11 18:21:26,220 [system1-akka.actor.default-dispatcher-4] INFO  
> test.akka.deploy.TestActor - [1] TestActor constructed: 
> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
> 2014-03-11 18:21:26,221 [system1-akka.actor.default-dispatcher-4] INFO  
> test.akka.deploy.TestActor - [1] starting: 
> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
> 2014-03-11 18:21:26,221 [system1-akka.actor.default-dispatcher-4] DEBUG 
> akka.serialization.Serialization(akka://system1) - Using 
> serializer[akka.serialization.JavaSerializer] for message 
> [akka.dispatch.sysmsg.Supervise]
> 2014-03-11 18:21:27,069 [system1-akka.actor.default-dispatcher-4] DEBUG 
> akka.serialization.Serialization(akka://system1) - Using 
> serializer[akka.serialization.JavaSerializer] for message 
> [akka.remote.RemoteWatcher$HeartbeatRsp]
> 2014-03-11 18:21:36,896 [system1-akka.actor.default-dispatcher-3] INFO  
> akka.actor.LocalActorRef - Message 
> [akka.remote.transport.AssociationHandle$Disassociated] from 
> Actor[akka://system1/deadLetters] to 
> Actor[akka://system1/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2Fsystem1%40127.0.0.1%3A59280-1#-388257538]
>  was not delivered. [1] dead letters encountered. This logging can be turned 
> off or adjusted with configuration settings 'akka.log-dead-letters' and 
> 'akka.log-dead-letters-during-shutdown'.
> 2014-03-11 18:21:36,899 [system1-akka.actor.default-dispatcher-3] DEBUG 
> akka.remote.EndpointWriter - Disassociated 
> [akka.tcp://[email protected]:2551] <- [akka.tcp://[email protected]:2552]
> 2014-03-11 18:21:36,905 [system1-akka.actor.default-dispatcher-3] WARN  
> akka.remote.ReliableDeliverySupervisor - Association with remote system 
> [akka.tcp://[email protected]:2552] has failed, address is now gated for 
> [5000] ms. Reason is: [Disassociated].
> 2014-03-11 18:21:36,910 [system1-akka.actor.default-dispatcher-4] DEBUG 
> akka.remote.EndpointWriter - Disassociated 
> [akka.tcp://[email protected]:2551] <- [akka.tcp://[email protected]:2552]
> 2014-03-11 18:21:36,911 [system1-akka.actor.default-dispatcher-4] INFO  
> akka.actor.LocalActorRef - Message 
> [akka.remote.transport.ActorTransportAdapter$DisassociateUnderlying] from 
> Actor[akka://system1/deadLetters] to 
> Actor[akka://system1/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2Fsystem1%40127.0.0.1%3A59280-1#-388257538]
>  was not delivered. [2] dead letters encountered. This logging can be turned 
> off or adjusted with configuration settings 'akka.log-dead-letters' and 
> 'akka.log-dead-letters-during-shutdown'.
> 2014-03-11 18:21:52,939 [system1-akka.actor.default-dispatcher-4] DEBUG 
> Remoting - Associated [akka.tcp://[email protected]:2551] <- 
> [akka.tcp://[email protected]:2552]
> 2014-03-11 18:21:52,993 [system1-akka.actor.default-dispatcher-4] DEBUG 
> LocalActorRefProvider(akka://system1) - Received command 
> [DaemonMsgCreate(Props(Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka.tcp://[email protected]:2551),,),class
>  
> test.akka.deploy.TestActor,Vector()),Deploy(,Config(SimpleConfigObject({})),NoRouter,RemoteScope(akka.tcp://[email protected]:2551),,),akka.tcp://[email protected]:2551/remote/akka.tcp/[email protected]:2552/user/test#-112687826,Actor[akka.tcp://[email protected]:2552/user])]
>  to RemoteSystemDaemon on [akka://system1]
> 2014-03-11 18:21:52,993 [system1-akka.actor.default-dispatcher-4] DEBUG 
> LocalActorRefProvider(akka://system1) - akka://system1/remote replacing child 
> akka.tcp/[email protected]:2552/user/test 
> (Actor[akka://system1/remote/akka.tcp/[email protected]:2552/user/test#2077035188]
>  -> 
> Actor[akka://system1/remote/akka.tcp/[email protected]:2552/user/test#-112687826])
> 2014-03-11 18:21:52,993 [system1-akka.actor.default-dispatcher-4] INFO  
> test.akka.deploy.TestActor - [2] TestActor constructed: 
> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
> 2014-03-11 18:21:52,994 [system1-akka.actor.default-dispatcher-4] INFO  
> test.akka.deploy.TestActor - [2] starting: 
> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
> 2014-03-11 18:21:53,010 [system1-akka.actor.default-dispatcher-4] DEBUG 
> akka.remote.EndpointWriter - Associated [akka.tcp://[email protected]:2551] 
> -> [akka.tcp://[email protected]:2552]
> 
> Thanks,
> Jim
> 
> B/
> 
> 
> 
>> 
>> 
>> 2014-03-06 18:47:34,134 [system1-akka.actor.default-dispatcher-4] INFO  
>> akka.event.slf4j.Slf4jLogger - Slf4jLogger started
>> 2014-03-06 18:47:34,173 [system1-akka.actor.default-dispatcher-4] INFO  
>> Remoting - Starting remoting
>> 2014-03-06 18:47:34,314 [system1-akka.actor.default-dispatcher-4] INFO  
>> Remoting - Remoting started; listening on addresses 
>> :[akka.tcp://[email protected]:2551]
>> 2014-03-06 18:47:34,315 [system1-akka.actor.default-dispatcher-4] INFO  
>> Remoting - Remoting now listens on addresses: 
>> [akka.tcp://[email protected]:2551]
>> 2014-03-06 18:47:40,588 [system1-akka.actor.default-dispatcher-4] INFO  
>> test.akka.deploy.TestActor - [1] TestActor constructed: 
>> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
>> 2014-03-06 18:47:40,589 [system1-akka.actor.default-dispatcher-4] INFO  
>> test.akka.deploy.TestActor - [1] starting: 
>> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
>> 2014-03-06 18:47:44,349 [system1-akka.actor.default-dispatcher-4] INFO  
>> akka.actor.LocalActorRef - Message 
>> [akka.remote.transport.AssociationHandle$Disassociated] from 
>> Actor[akka://system1/deadLetters] to 
>> Actor[akka://system1/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2Fsystem1%40127.0.0.1%3A60959-1#772527695]
>>  was not delivered. [1] dead letters encountered. This logging can be turned 
>> off or adjusted with configuration settings 'akka.log-dead-letters' and 
>> 'akka.log-dead-letters-during-shutdown'.
>> 2014-03-06 18:47:44,355 [system1-akka.actor.default-dispatcher-4] WARN  
>> akka.remote.ReliableDeliverySupervisor - Association with remote system 
>> [akka.tcp://[email protected]:2552] has failed, address is now gated for 
>> [5000] ms. Reason is: [Disassociated].
>> 2014-03-06 18:47:44,359 [system1-akka.actor.default-dispatcher-3] INFO  
>> akka.actor.LocalActorRef - Message 
>> [akka.remote.transport.ActorTransportAdapter$DisassociateUnderlying] from 
>> Actor[akka://system1/deadLetters] to 
>> Actor[akka://system1/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2Fsystem1%40127.0.0.1%3A60959-1#772527695]
>>  was not delivered. [2] dead letters encountered. This logging can be turned 
>> off or adjusted with configuration settings 'akka.log-dead-letters' and 
>> 'akka.log-dead-letters-during-shutdown'.
>> 2014-03-06 18:47:47,009 [system1-akka.actor.default-dispatcher-4] INFO  
>> test.akka.deploy.TestActor - [2] TestActor constructed: 
>> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
>> 2014-03-06 18:47:47,009 [system1-akka.actor.default-dispatcher-4] INFO  
>> test.akka.deploy.TestActor - [2] starting: 
>> akka://system1/remote/akka.tcp/[email protected]:2552/user/test
>> 2014-03-06 18:47:47,923 [system1-akka.actor.default-dispatcher-4] INFO  
>> akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef - Message 
>> [akka.remote.RemoteWatcher$HeartbeatRsp] from 
>> Actor[akka://system1/system/remote-watcher#-567884851] to 
>> Actor[akka://system1/deadLetters] was not delivered. [3] dead letters 
>> encountered. This logging can be turned off or adjusted with configuration 
>> settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
>> 2014-03-06 18:47:48,909 [system1-akka.actor.default-dispatcher-4] INFO  
>> akka.remote.RemoteActorRefProvider$RemoteDeadLetterActorRef - Message 
>> [akka.remote.RemoteWatcher$HeartbeatRsp] from 
>> Actor[akka://system1/system/remote-watcher#-567884851] to 
>> Actor[akka://system1/deadLetters] was not delivered. [4] dead letters 
>> encountered. This logging can be turned off or adjusted with configuration 
>> settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
>> 
>> Jim
>> 
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> Björn Antonsson
> Typesafe – Reactive Apps on the JVM
> twitter: @bantonsson
> 
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to