HyukjinKwon commented on a change in pull request #32126:
URL: https://github.com/apache/spark/pull/32126#discussion_r611320198
##########
File path:
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/BaseYarnClusterSuite.scala
##########
@@ -90,9 +90,31 @@ abstract class BaseYarnClusterSuite
yarnConf.set("yarn.scheduler.capacity.root.default.acl_administer_queue",
"*")
yarnConf.setInt("yarn.scheduler.capacity.node-locality-delay", -1)
- yarnCluster = new MiniYARNCluster(getClass().getName(), 1, 1, 1)
- yarnCluster.init(yarnConf)
- yarnCluster.start()
+ try {
+ yarnCluster = new MiniYARNCluster(getClass().getName(), 1, 1, 1)
+ yarnCluster.init(yarnConf)
+ yarnCluster.start()
+ } catch {
+ case _: java.net.BindException =>
+ // When InetAddress.getLocalHost returns a wrong address, see also
SPARK-35002.
+ val original = System.getSecurityManager
+ System.setSecurityManager(new java.lang.SecurityManager() {
+ override def checkConnect(host: String, port: Int): Unit = {
+ if (host != "localhost" || host != "127.0.0.1") {
+ // Reject all hosts except loopback.
+ throw new SecurityException("Loopback only allowed")
Review comment:
This forces `InetAddress.getLocalHost` to return the loopback address.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]