Skip to content

Commit

Permalink
Use IP address on the executor side instead of hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
catalinii committed Oct 12, 2022
1 parent 46bb556 commit 21808bc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/src/main/scala/org/apache/spark/SparkEnv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@
package org.apache.spark

import java.io.File
import java.net.Socket
import java.net.{InetAddress, Socket}
import java.util.Locale

import scala.collection.JavaConverters._
import scala.collection.concurrent
import scala.collection.mutable
import scala.util.Properties

import com.google.common.cache.CacheBuilder
import org.apache.hadoop.conf.Configuration

import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.api.python.PythonWorkerFactory
import org.apache.spark.broadcast.BroadcastManager
import org.apache.spark.internal.{config, Logging}
import org.apache.spark.internal.{Logging, config}
import org.apache.spark.internal.config._
import org.apache.spark.memory.{MemoryManager, UnifiedMemoryManager}
import org.apache.spark.metrics.{MetricsSystem, MetricsSystemInstances}
Expand Down Expand Up @@ -204,11 +201,15 @@ object SparkEnv extends Logging {
numCores: Int,
ioEncryptionKey: Option[Array[Byte]],
isLocal: Boolean): SparkEnv = {
var hostnameFinal = hostname
if (conf.getBoolean("spark.lyft.resolve", false)) {
hostnameFinal = InetAddress.getByName(hostname).getHostAddress
}
val env = create(
conf,
executorId,
bindAddress,
hostname,
hostnameFinal,
None,
isLocal,
numCores,
Expand Down

0 comments on commit 21808bc

Please sign in to comment.