How to handle UnknownHostException when telling to remote actor

589 views
Skip to first unread message

Rick Latrine

unread,
Jun 19, 2013, 9:20:29 AM6/19/13
to akka...@googlegroups.com
Hi,

when trying to tell a message to an unknown host, akka is "swallowing exception during message send".

The code is:
                String path = "akka://akkatestsys@sillyhost:2552/user/RemoteActor";
                ActorRef actorRef = getContext().actorFor(path);
                actorRef .tell("hello", self());

After tell is executed I see following log output:

[ERROR] [06/19/2013 15:17:21.196] [akkatestsys-akka.actor.default-dispatcher-4] [akka://akkatestsys@sillyhost:2552/user/RemoteActor] swallowing exception during message send
java.net.UnknownHostException: sillyhost
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1211)
    at java.net.InetAddress.getAllByName(InetAddress.java:1127)
    at java.net.InetAddress.getAllByName(InetAddress.java:1063)
    at java.net.InetAddress.getByName(InetAddress.java:1013)
    at akka.remote.netty.ActiveRemoteClient$$anonfun$1.apply$mcV$sp(Client.scala:165)
    at akka.util.Switch.transcend(LockUtil.scala:27)
    at akka.util.Switch.switchOn(LockUtil.scala:48)
    at akka.remote.netty.ActiveRemoteClient.connect(Client.scala:150)
    at akka.remote.netty.NettyRemoteTransport.send(NettyRemoteSupport.scala:242)
    at akka.remote.RemoteActorRef.$bang(RemoteActorRefProvider.scala:260)
    at akka.actor.ActorRef.tell(ActorRef.scala:109)

Is there any chance to get a message about that failure?
Or how to handle such situations?

Akka version used: 2.1.4

Cheers
Rick

√iktor Ҡlang

unread,
Jun 19, 2013, 9:34:04 AM6/19/13
to Akka User List
Hi Rick!


A message to where? (did you check RemoteLifecycleEvents: http://doc.akka.io/docs/akka/2.1.4/scala/remoting.html#Remote_Events ?) 
 
Or how to handle such situations?

#define handle

Cheers,
 

Akka version used: 2.1.4

Cheers

Rick

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



--
Viktor Klang
Director of Engineering

Twitter: @viktorklang

Rick Latrine

unread,
Jun 19, 2013, 9:51:40 AM6/19/13
to akka...@googlegroups.com
Yes, I subscribed to RemoteLifeCycleEvent, but no event message arrives at all.

Handle means, if you expect such "swallowed exceptions", then how do you deal with such situations.
E.g. timeout is one option, but I would like to know of such errors.

√iktor Ҡlang

unread,
Jun 19, 2013, 9:59:39 AM6/19/13
to Akka User List
On Wed, Jun 19, 2013 at 9:51 AM, Rick Latrine <latr...@yahoo.de> wrote:
Yes, I subscribed to RemoteLifeCycleEvent, but no event message arrives at all.

That is surprising! Open a ticket about that please.
 

Handle means, if you expect such "swallowed exceptions", then how do you deal with such situations.
 
You mean how do you deal with reliable messaging? http://doc.akka.io/docs/akka/2.1.4/general/message-delivery-guarantees.html
 
E.g. timeout is one option, but I would like to know of such errors.

As for unavailability-notifications, that's what DeathWatch is for (for 2.2 and forward DeathWatch works with node failure detection in both remoting and clustering).


Does that help?

Cheers,

Rick Latrine

unread,
Jun 19, 2013, 10:11:02 AM6/19/13
to akka...@googlegroups.com
Ok, I will file a ticket then.

Yes, I know what reliable messaging is. I use timeouts when talking to unreliable endpoints.
But the unknown host exception is thrown immediately.
So maybe there is a way to turn that exc into a RemoteLifeCycleEvent message.

I'm waiting a long long time for remote DeathWatch.
That sounds great!

Rick Latrine

unread,
Jun 19, 2013, 10:22:00 AM6/19/13
to akka...@googlegroups.com

√iktor Ҡlang

unread,
Jun 19, 2013, 10:22:23 AM6/19/13
to Akka User List
On Wed, Jun 19, 2013 at 10:11 AM, Rick Latrine <latr...@yahoo.de> wrote:
Ok, I will file a ticket then.


Thanks!
 
Yes, I know what reliable messaging is. I use timeouts when talking to unreliable endpoints.
But the unknown host exception is thrown immediately.

No, it's being thrown inside the remoting, we have a rule that tell/bang must not throw exceptions, lost messages must be dealt with in a uniform matter no matter the cause (dropped packet or unknown host the same).
 
So maybe there is a way to turn that exc into a RemoteLifeCycleEvent message.

Yeah, I was surprised that it wasn't, as it should be a failure to connect event.
 

I'm waiting a long long time for remote DeathWatch.

Me too :)
 
That sounds great!

Thanks, enjoy!
Reply all
Reply to author
Forward
0 new messages