[KYUUBI #7153] Share JAAS configuration for Zookeeper client to avoid server OOM
Some checks failed
CI / Kyuubi and Spark Test (normal, , 17, 3.3, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 17, 3.4, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 17, 3.5, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 21, 4.0, -Pscala-2.13) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 8, 3.3, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 8, 3.4, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 8, 3.5, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-3.2-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.HudiTest,org.a… (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-3.3-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.HudiTest,org.a… (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-3.4-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.SparkLocalClus… (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-4.0-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.SparkLocalClus… (push) Has been cancelled
CI / Scala Test (8, 2.13, 3.5) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.12, 3.5, 3.3) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.12, 3.5, 3.4) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.13, 3.5, 3.3) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.13, 3.5, 3.4) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.13, 3.5, 4.0) (push) Has been cancelled
CI / Flink Test (normal, 1.17, , 8) (push) Has been cancelled
CI / Flink Test (normal, 1.18, , 8) (push) Has been cancelled
CI / Flink Test (normal, 1.19, , 8) (push) Has been cancelled
CI / Flink Test (normal, 1.20, , 8) (push) Has been cancelled
CI / Flink Test (verify-on-flink-1.17-binary, 1.20, -Dflink.archive.mirror=https://archive.apache.org/dist/flink/flink-1.17.2 -Dflink.archive.name=flink-1.17.2-bin-scala_2.12.tgz, 8) (push) Has been cancelled
CI / Flink Test (verify-on-flink-1.18-binary, 1.20, -Dflink.archive.mirror=https://archive.apache.org/dist/flink/flink-1.18.1 -Dflink.archive.name=flink-1.18.1-bin-scala_2.12.tgz, 8) (push) Has been cancelled
CI / Flink Test (verify-on-flink-1.19-binary, 1.20, -Dflink.archive.mirror=https://archive.apache.org/dist/flink/flink-1.19.1 -Dflink.archive.name=flink-1.19.1-bin-scala_2.12.tgz, 8) (push) Has been cancelled
CI / Hive Test (normal, , 8) (push) Has been cancelled
CI / Hive Test (verify-on-hive-2.1-cdh6-binary, -Dhive.archive.mirror=https://github.com/pan3793/cdh-hive/releases/download/cdh6.3.2-release -Dhive.archive.name=apache-hive-2.1.1-cdh6.3.2-bin.tar.gz, 8) (push) Has been cancelled
CI / Hive Test (verify-on-hive-2.3-binary, -Dhive.archive.mirror=https://archive.apache.org/dist/hive/hive-2.3.10 -Dhive.archive.name=apache-hive-2.3.10-bin.tar.gz, 8) (push) Has been cancelled
CI / JDBC Trino TPC Tests (normal, 8) (push) Has been cancelled
CI / Kyuubi Server On Kubernetes Integration Test (push) Has been cancelled
CI / Spark Engine On Kubernetes Integration Test (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.4) (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.5) (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.6) (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.7) (push) Has been cancelled
Python Client / unit-test (3.10) (push) Has been cancelled
Python Client / unit-test (3.8) (push) Has been cancelled
Python Client / unit-test (3.9) (push) Has been cancelled
Web UI / Kyuubi Web UI check (push) Has been cancelled
Some checks failed
CI / Kyuubi and Spark Test (normal, , 17, 3.3, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 17, 3.4, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 17, 3.5, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 21, 4.0, -Pscala-2.13) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 8, 3.3, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 8, 3.4, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (normal, , 8, 3.5, ) (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-3.2-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.HudiTest,org.a… (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-3.3-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.HudiTest,org.a… (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-3.4-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.SparkLocalClus… (push) Has been cancelled
CI / Kyuubi and Spark Test (verify-on-spark-4.0-binary, -Dmaven.plugin.scalatest.exclude.tags=org.scalatest.tags.Slow,org.apache.kyuubi.tags.DeltaTest,org.apache.kyuubi.tags.IcebergTest,org.apache.kyuubi.tags.PaimonTest,org.apache.kyuubi.tags.SparkLocalClus… (push) Has been cancelled
CI / Scala Test (8, 2.13, 3.5) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.12, 3.5, 3.3) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.12, 3.5, 3.4) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.13, 3.5, 3.3) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.13, 3.5, 3.4) (push) Has been cancelled
CI / Spark Connector Cross Version Test (normal, 17, 2.13, 3.5, 4.0) (push) Has been cancelled
CI / Flink Test (normal, 1.17, , 8) (push) Has been cancelled
CI / Flink Test (normal, 1.18, , 8) (push) Has been cancelled
CI / Flink Test (normal, 1.19, , 8) (push) Has been cancelled
CI / Flink Test (normal, 1.20, , 8) (push) Has been cancelled
CI / Flink Test (verify-on-flink-1.17-binary, 1.20, -Dflink.archive.mirror=https://archive.apache.org/dist/flink/flink-1.17.2 -Dflink.archive.name=flink-1.17.2-bin-scala_2.12.tgz, 8) (push) Has been cancelled
CI / Flink Test (verify-on-flink-1.18-binary, 1.20, -Dflink.archive.mirror=https://archive.apache.org/dist/flink/flink-1.18.1 -Dflink.archive.name=flink-1.18.1-bin-scala_2.12.tgz, 8) (push) Has been cancelled
CI / Flink Test (verify-on-flink-1.19-binary, 1.20, -Dflink.archive.mirror=https://archive.apache.org/dist/flink/flink-1.19.1 -Dflink.archive.name=flink-1.19.1-bin-scala_2.12.tgz, 8) (push) Has been cancelled
CI / Hive Test (normal, , 8) (push) Has been cancelled
CI / Hive Test (verify-on-hive-2.1-cdh6-binary, -Dhive.archive.mirror=https://github.com/pan3793/cdh-hive/releases/download/cdh6.3.2-release -Dhive.archive.name=apache-hive-2.1.1-cdh6.3.2-bin.tar.gz, 8) (push) Has been cancelled
CI / Hive Test (verify-on-hive-2.3-binary, -Dhive.archive.mirror=https://archive.apache.org/dist/hive/hive-2.3.10 -Dhive.archive.name=apache-hive-2.3.10-bin.tar.gz, 8) (push) Has been cancelled
CI / JDBC Trino TPC Tests (normal, 8) (push) Has been cancelled
CI / Kyuubi Server On Kubernetes Integration Test (push) Has been cancelled
CI / Spark Engine On Kubernetes Integration Test (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.4) (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.5) (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.6) (push) Has been cancelled
CI / Zookeeper Integration Test (normal, 8, 3.7) (push) Has been cancelled
Python Client / unit-test (3.10) (push) Has been cancelled
Python Client / unit-test (3.8) (push) Has been cancelled
Python Client / unit-test (3.9) (push) Has been cancelled
Web UI / Kyuubi Web UI check (push) Has been cancelled
### Why are the changes needed? Sharing jaas configuration for zookeeper client with same keytab and principal to avoid server oom due to nested jaas configuration. fix issue https://github.com/apache/kyuubi/issues/7153 ### How was this patch tested? ut ### Was this patch authored or co-authored using generative AI tooling? no Closes #7154 from Z1Wu/fix/comm_reuse_zk_jass. Closes #7153 3b0169a00 [Cheng Pan] Update kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/zookeeper/ZookeeperClientProvider.scala 5873d12f3 [Cheng Pan] Update kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/zookeeper/ZookeeperClientProvider.scala 0d8a18a4e [wuziyi] nit ffa7d29fc [wuziyi] [fix] share jaas configuration for zookeeper client with same keytab and principal to avoid server oom due to recursive jaas configuration. Lead-authored-by: wuziyi <wuziyi02@corp.netease.com> Co-authored-by: Cheng Pan <pan3793@gmail.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
parent
fb2b7ef9c6
commit
f7e10e65d3
@ -19,6 +19,7 @@ package org.apache.kyuubi.ha.client.zookeeper
|
||||
|
||||
import java.io.{File, IOException}
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import javax.security.auth.login.Configuration
|
||||
|
||||
import scala.util.Random
|
||||
@ -38,6 +39,13 @@ import org.apache.kyuubi.util.reflect.DynConstructors
|
||||
|
||||
object ZookeeperClientProvider extends Logging {
|
||||
|
||||
/**
|
||||
* Share JAAS configuration for Zookeeper client with same keytab and principal to
|
||||
* avoid server OOM due to each new JAAS configuration references the previous instance.
|
||||
* See KYUUBI #7154 for more details.
|
||||
*/
|
||||
val jaasConfigurationCache = new ConcurrentHashMap[(String, String), Configuration]()
|
||||
|
||||
/**
|
||||
* Create a [[CuratorFramework]] instance to be used as the ZooKeeper client
|
||||
* Use the [[ZookeeperACLProvider]] to create appropriate ACLs
|
||||
@ -113,22 +121,26 @@ object ZookeeperClientProvider extends Logging {
|
||||
System.setProperty("zookeeper.server.principal", zkServerPrincipal)
|
||||
}
|
||||
val zkClientPrincipal = KyuubiHadoopUtils.getServerPrincipal(principal)
|
||||
// HDFS-16591 makes breaking change on JaasConfiguration
|
||||
val jaasConf = DynConstructors.builder()
|
||||
.impl( // Hadoop 3.3.5 and above
|
||||
"org.apache.hadoop.security.authentication.util.JaasConfiguration",
|
||||
classOf[String],
|
||||
classOf[String],
|
||||
classOf[String])
|
||||
.impl( // Hadoop 3.3.4 and previous
|
||||
// scalastyle:off
|
||||
"org.apache.hadoop.security.token.delegation.ZKDelegationTokenSecretManager$JaasConfiguration",
|
||||
// scalastyle:on
|
||||
classOf[String],
|
||||
classOf[String],
|
||||
classOf[String])
|
||||
.build[Configuration]()
|
||||
.newInstance("KyuubiZooKeeperClient", zkClientPrincipal, keytab)
|
||||
val jaasConf = jaasConfigurationCache.computeIfAbsent(
|
||||
(principal, keytab),
|
||||
_ => {
|
||||
// HDFS-16591 makes breaking change on JaasConfiguration
|
||||
DynConstructors.builder()
|
||||
.impl( // Hadoop 3.3.5 and above
|
||||
"org.apache.hadoop.security.authentication.util.JaasConfiguration",
|
||||
classOf[String],
|
||||
classOf[String],
|
||||
classOf[String])
|
||||
.impl( // Hadoop 3.3.4 and previous
|
||||
// scalastyle:off
|
||||
"org.apache.hadoop.security.token.delegation.ZKDelegationTokenSecretManager$JaasConfiguration",
|
||||
// scalastyle:on
|
||||
classOf[String],
|
||||
classOf[String],
|
||||
classOf[String])
|
||||
.build[Configuration]()
|
||||
.newInstance("KyuubiZooKeeperClient", zkClientPrincipal, keytab)
|
||||
})
|
||||
Configuration.setConfiguration(jaasConf)
|
||||
case _ =>
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user