Skip to content

Commit 2532668

Browse files
SPARK-3883: Refactored AkkaUtils.protocol method to not use Try
1 parent 90a8762 commit 2532668

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/main/scala/org/apache/spark/util/AkkaUtils.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ private[spark] object AkkaUtils extends Logging {
239239
}
240240

241241
def protocol(actorSystem: ActorSystem): String = {
242-
protocol(Try {
243-
actorSystem.settings.config.getBoolean("akka.remote.netty.tcp.enable-ssl")
244-
}.getOrElse(false))
242+
val akkaConf = actorSystem.settings.config
243+
val sslProp = "akka.remote.netty.tcp.enable-ssl"
244+
protocol(akkaConf.hasPath(sslProp) && akkaConf.getBoolean(sslProp))
245245
}
246246

247247
def protocol(ssl: Boolean = false): String = {

0 commit comments

Comments
 (0)