Skip to content

Commit

Permalink
[FLINK-5492] [log] Log unresolved address when starting an ActorSystem
Browse files Browse the repository at this point in the history
With the Flakka changes we no longer resolve the given hostname into an IP. Thus,
we should henceforth log the unresolved hostname as the address to which the
ActorSystem binds to.

This closes apache#3161.
  • Loading branch information
tillrohrmann committed Jan 23, 2017
1 parent 43eee90 commit 3b32d1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static ActorSystem startActorSystem(
int listeningPort,
Logger logger) throws Exception {

String hostPortUrl = NetUtils.hostAndPortToUrlString(listeningAddress, listeningPort);
String hostPortUrl = listeningAddress + ':' + listeningPort;
logger.info("Trying to start actor system at {}", hostPortUrl);

try {
Expand All @@ -146,7 +146,8 @@ public static ActorSystem startActorSystem(
logger.debug("Using akka configuration\n {}", akkaConfig);

ActorSystem actorSystem = AkkaUtils.createActorSystem(akkaConfig);
logger.info("Actor system started at {}", hostPortUrl);

logger.info("Actor system started at {}", AkkaUtils.getAddress(actorSystem));
return actorSystem;
}
catch (Throwable t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1741,8 +1741,7 @@ object TaskManager {

// Bring up the TaskManager actor system first, bind it to the given address.

LOG.info("Starting TaskManager actor system at " +
NetUtils.hostAndPortToUrlString(taskManagerHostname, actorSystemPort))
LOG.info("Starting TaskManager actor system at {}:{}.", taskManagerHostname, actorSystemPort)

val taskManagerSystem = try {
val akkaConfig = AkkaUtils.getAkkaConfig(
Expand All @@ -1759,9 +1758,8 @@ object TaskManager {
if (t.isInstanceOf[org.jboss.netty.channel.ChannelException]) {
val cause = t.getCause()
if (cause != null && t.getCause().isInstanceOf[java.net.BindException]) {
val address = NetUtils.hostAndPortToUrlString(taskManagerHostname, actorSystemPort)
throw new IOException("Unable to bind TaskManager actor system to address " +
address + " - " + cause.getMessage(), t)
taskManagerHostname + ':' + actorSystemPort + " - " + cause.getMessage(), t)
}
}
throw new Exception("Could not create TaskManager actor system", t)
Expand Down

0 comments on commit 3b32d1b

Please sign in to comment.