I still feel like it's somewhat ambiguous in a remoting context, because there 
is not a one-to-one relationship, but the only remaining issue I really have is 
that there seems to be no way of preventing a fair amount of scary logs on the 
server when the client process exits:

[INFO] [01/10/2014 19:43:55.950] 
[RemoteOperationsServer-11000-akka.actor.default-dispatcher-5] 
[akka://RemoteOperationsServer-11000/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FRemoteOperationsServer-11000%4010.120.2.49%3A57256-1]
 Message [akka.remote.transport.ActorTransportAdapter$DisassociateUnderlying] 
from 
Actor[akka://RemoteOperationsServer-11000/deadLetters<akka://RemoteOperationsServer-11000/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FRemoteOperationsServer-11000%4010.120.2.49%3A57256-1]%20Message%20[akka.remote.transport.ActorTransportAdapter$DisassociateUnderlying]%20from%20Actor[akka://RemoteOperationsServer-11000/deadLetters>]
 to 
Actor[akka://RemoteOperationsServer-11000/system/transports/akkaprotocolmanager.tcp0/akkaProtocol-tcp%3A%2F%2FRemoteOperationsServer-11000%4010.120.2.49%3A57256-1#-800873166]
 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'.
[ERROR] [01/10/2014 19:43:55.970] 
[RemoteOperationsServer-11000-akka.actor.default-dispatcher-4] 
[akka://RemoteOperationsServer-11000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteOperationsClient%40eriks-macbook.local%3A3001-0/endpointWriter]
 AssociationError 
[akka.tcp://RemoteOperationsServer-11000@eriks-macbook.local:11000] 
-<akka://RemoteOperationsServer-11000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteOperationsClient%40eriks-macbook.local%3A3001-0/endpointWriter]%20AssociationError%20[akka.tcp://RemoteOperationsServer-11000@eriks-macbook.local:11000]%20->>
 [akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]: Error 
[Association failed with 
[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]<akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]:%20Error%20[Association%20failed%20with%20[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]>]
 [
akka.remote.EndpointAssociationException: Association failed with 
[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]
Caused by: 
akka.remote.transport.netty.NettyTransport$$anonfun$associate$1$$anon$2: 
Connection refused: eriks-macbook.local/10.120.2.49:3001
]
[ERROR] [01/10/2014 19:43:55.973] 
[RemoteOperationsServer-11000-akka.actor.default-dispatcher-5] 
[akka://RemoteOperationsServer-11000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteOperationsClient%40eriks-macbook.local%3A3001-0/endpointWriter]
 AssociationError 
[akka.tcp://RemoteOperationsServer-11000@eriks-macbook.local:11000] 
-<akka://RemoteOperationsServer-11000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteOperationsClient%40eriks-macbook.local%3A3001-0/endpointWriter]%20AssociationError%20[akka.tcp://RemoteOperationsServer-11000@eriks-macbook.local:11000]%20->>
 [akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]: Error 
[Association failed with 
[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]<akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]:%20Error%20[Association%20failed%20with%20[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]>]
 [
akka.remote.EndpointAssociationException: Association failed with 
[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]
Caused by: 
akka.remote.transport.netty.NettyTransport$$anonfun$associate$1$$anon$2: 
Connection refused: eriks-macbook.local/10.120.2.49:3001
]
[ERROR] [01/10/2014 19:43:55.976] 
[RemoteOperationsServer-11000-akka.actor.default-dispatcher-3] 
[akka://RemoteOperationsServer-11000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteOperationsClient%40eriks-macbook.local%3A3001-0/endpointWriter]
 AssociationError 
[akka.tcp://RemoteOperationsServer-11000@eriks-macbook.local:11000] 
-<akka://RemoteOperationsServer-11000/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FRemoteOperationsClient%40eriks-macbook.local%3A3001-0/endpointWriter]%20AssociationError%20[akka.tcp://RemoteOperationsServer-11000@eriks-macbook.local:11000]%20->>
 [akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]: Error 
[Association failed with 
[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]<akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]:%20Error%20[Association%20failed%20with%20[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]>]
 [
akka.remote.EndpointAssociationException: Association failed with 
[akka.tcp://RemoteOperationsClient@eriks-macbook.local:3001]
Caused by: 
akka.remote.transport.netty.NettyTransport$$anonfun$associate$1$$anon$2: 
Connection refused: eriks-macbook.local/10.120.2.49:3001
]


I'm a pretty big proponent of there not being things in a log labeled ERROR if 
there is no error, but if I can't disassociate an actor ref this is inevitable.

Thanks,

 erik

On Jan 12, 2014, at 2:56 AM, √iktor Ҡlang 
<viktor.kl...@gmail.com<mailto:viktor.kl...@gmail.com>> wrote:


Hi Erik,

Akka's semantics of stop I'd say is quite well documented, both in the 
reference documentation:

http://doc.akka.io/docs/akka/2.2.3/scala/actors.html#Stopping_actors

And in code:

" ActorRef does not have a method for terminating the actor it points to, use 
akka.actor.ActorRefFactory.stop(ref), or send a akka.actor.PoisonPill, for this 
purpose" - http://doc.akka.io/api/akka/2.2.3/#akka.actor.ActorRef

" abstract def
stop(actor: ActorRef): Unit
Stop the actor pointed to by the given akka.actor.ActorRef; this is an 
asynchronous operation, i.e. involves a message send." - 
http://doc.akka.io/api/akka/2.2.3/#akka.actor.ActorRefFactory

Cheers,
V

On Jan 12, 2014 9:08 AM, "Erik Nelson" 
<e...@gravity.com<mailto:e...@gravity.com>> wrote:
Thank you!

I will say that, even though I understand why this is the case, it's a bit 
strange in practice. Given the fact that multiple clients can connect to the 
same server, the ability to terminate that way is, well... perhaps a bit 
strange.

I suspect it will not be an issue now that I have figured it out, but this 
might be something that could use a brief call out in the documentation - even 
just a single sentence indicating that stopping a remote associated ActorRef 
will stop the associated actor as well. I know that would have saved me a 
pretty big chunk of time!

 erik

On Jan 11, 2014, at 6:08 AM, Patrik Nordwall 
<patrik.nordw...@gmail.com<mailto:patrik.nordw...@gmail.com>> wrote:

Hi Erik,

There is no way to shutdown/close a remote connection.
When you say that you shutdown the ActorRef, I guess that you are using 
system.stop(ref), which stops the actor. Thereafter you can't identify the 
actor again, because the actor is terminated.

At some point we might implement automatic disassociation of idle connections.

Regards,
Patrik



On Sat, Jan 11, 2014 at 4:27 AM, Erik Nelson 
<e...@gravity.com<mailto:e...@gravity.com>> wrote:
Hi gang,

I've been playing with our remoting connection management library, and ran into 
a bit of a problem. I want to be able to disconnect and reconnect to a given 
server, but if I shutdown a local ActorRef that is associated with a remote 
actor, the remote becomes unable to accept new connections. I assume this is by 
design - the shutdown happens both locally and remotely(*). But I can't figure 
out how to just DISASSOCIATE the local actor ref, and I feel like if I don't 
then I'm going to have a memory leak over time. It's possible that this is only 
an issue in my test case, since in reality the case is that I only disconnect 
when the server goes down.

But it Just Feels Wrong to not be able to shut down that remotely associated 
ActorRef! I can't find anything in the documentation, and the Disassociate 
class definitely doesn't seem to be something I should be using directly.

This is with 2.2.3, and I'm using actor selection.

(*) What I see actually happening in the debug logging is that when the server 
gets the Identify and tries to create its reciprocal connection to the client 
to respond, it gets a connection refused. And then goes ahead sending the 
Identify, but with a None as the ActorRef. The client has definitely reported 
listening on the port in question, so I feel like the connection refused is a 
red herring, and the reality is that it has no ActorRef to respond with because 
something internal has shut down.

Thanks!

 erik


--
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      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 
akka-user+unsubscr...@googlegroups.com<mailto:akka-user%2bunsubscr...@googlegroups.com>.
To post to this group, send email to 
akka-user@googlegroups.com<mailto:akka-user@googlegroups.com>.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.



--


Patrik Nordwall
Typesafe<http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 
akka-user+unsubscr...@googlegroups.com<mailto:akka-user+unsubscr...@googlegroups.com>.
To post to this group, send email to 
akka-user@googlegroups.com<mailto:akka-user@googlegroups.com>.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 
akka-user+unsubscr...@googlegroups.com<mailto:akka-user%2bunsubscr...@googlegroups.com>.
To post to this group, send email to 
akka-user@googlegroups.com<mailto:akka-user@googlegroups.com>.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 
akka-user+unsubscr...@googlegroups.com<mailto:akka-user+unsubscr...@googlegroups.com>.
To post to this group, send email to 
akka-user@googlegroups.com<mailto:akka-user@googlegroups.com>.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: http://akka.io/faq/
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to