This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/branch-1.7 by this push:
new ec1fafdea [KYUUBI #5045] Initialize
EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH before using
ec1fafdea is described below
commit ec1fafdea28e12a9c0c623fe15654a1f12bd7f51
Author: hezhao2 <[email protected]>
AuthorDate: Thu Jul 13 12:09:41 2023 +0800
[KYUUBI #5045] Initialize EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH before using
### _Why are the changes needed?_
I came cross an issue that is the the value of
EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH is 0 when the param is accessed in
generateExecutorPodNamePrefixForK8s method.
I tried to move the EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH ahead of
generateExecutorPodNamePrefixForK8s method. Then, I found this issue was gone.
So is it necessary to declare the EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH
variable before the method definition?
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including
negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] [Run
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
locally before make a pull request
Closes #5045 from zhaohehuhu/Improvement.
Closes #5045
c74732f0c [hezhao2] recover the blank line
99aa14b0c [hezhao2] fix the code style
29929a2cb [hezhao2] declare EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH param
before generateExecutorPodNamePrefixForK8s method
Authored-by: hezhao2 <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit da4af2aee7cd9d645d25227f836737b5fad4973f)
Signed-off-by: Cheng Pan <[email protected]>
---
.../scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
index d3783b4fc..bdbc7c08f 100644
---
a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
+++
b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
@@ -165,6 +165,10 @@ object SparkSQLEngine extends Logging {
private val sparkSessionCreated = new AtomicBoolean(false)
+ // Kubernetes pod name max length - '-exec-' - Int.MAX_VALUE.length
+ // 253 - 10 - 6
+ val EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH = 237
+
SignalRegister.registerLogger(logger)
setupConf()
@@ -391,8 +395,4 @@ object SparkSQLEngine extends Logging {
s"kyuubi-${UUID.randomUUID()}"
}
}
-
- // Kubernetes pod name max length - '-exec-' - Int.MAX_VALUE.length
- // 253 - 10 - 6
- val EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH = 237
}