Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH before using #5045

Closed
wants to merge 3 commits into from

Conversation

zhaohehuhu
Copy link
Contributor

@zhaohehuhu zhaohehuhu commented Jul 12, 2023

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 locally before make a pull request

@pan3793
Copy link
Member

pan3793 commented Jul 12, 2023

I don't think so, if you try to decompile the class file, the assignment should occur inside the constructor.

@zhaohehuhu
Copy link
Contributor Author

zhaohehuhu commented Jul 13, 2023

decompile

Yes. Is there another problem possibly lead to this ?

@pan3793
Copy link
Member

pan3793 commented Jul 13, 2023

Sorry, I missed setupConf() is called inside constructor too, then your analysis is right.

Please run dev/reformat to fix the code style.

@pan3793 pan3793 changed the title declare EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH param before generateExecutorPodNamePrefixForK8s method Initialize EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH before using Jul 13, 2023
@zhaohehuhu
Copy link
Contributor Author

setupConf

Got it. Thanks.

@@ -376,7 +380,6 @@ object SparkSQLEngine extends Logging {
// only spark driver pod will build with `SPARK_APPLICATION_ID` env.
Utils.isOnK8s && sys.env.contains("SPARK_APPLICATION_ID")
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: restore this blank line to minimize the change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it

Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only one minor thing

@pan3793 pan3793 closed this in da4af2a Jul 13, 2023
pan3793 pushed a commit that referenced this pull request Jul 13, 2023
…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

c74732f [hezhao2] recover the blank line
99aa14b [hezhao2] fix the code style
29929a2 [hezhao2]  declare EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH param before generateExecutorPodNamePrefixForK8s method

Authored-by: hezhao2 <hezhao2@cisco.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit da4af2a)
Signed-off-by: Cheng Pan <chengpan@apache.org>
@pan3793 pan3793 added this to the v1.7.2 milestone Jul 13, 2023
@pan3793
Copy link
Member

pan3793 commented Jul 13, 2023

Thanks, merged to master/1.7

link3280 pushed a commit to link3280/kyuubi that referenced this pull request Jul 23, 2023
…efore 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 apache#5045 from zhaohehuhu/Improvement.

Closes apache#5045

c74732f [hezhao2] recover the blank line
99aa14b [hezhao2] fix the code style
29929a2 [hezhao2]  declare EXECUTOR_POD_NAME_PREFIX_MAX_LENGTH param before generateExecutorPodNamePrefixForK8s method

Authored-by: hezhao2 <hezhao2@cisco.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
@zwangsheng
Copy link
Contributor

Hi @zhaohehuhu, after this PR, we need new feature about force rewrite executor pod name prefix, would you like to take it?
See more in #5654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants