Skip to content

Conversation

@proceane
Copy link
Contributor

What is this PR for?

This PR was created to prevent an error that occurs in the InterpreterSetting.getInterpreterGroup method when groupId is null and is retrieved from the Set.
Normally, the groupId parameter does not seem to be passed as null.
I found it when tested service shutdown(#4965).

What type of PR is it?

Improvement

Todos

  • - Add null check condition

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-6282

How should this be tested?

Screenshots (if appropriate)

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

Copy link
Contributor

@ParkGyeongTae ParkGyeongTae left a comment

Choose a reason for hiding this comment

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

As I understand it, groupId should never be null under normal conditions, but it might become null in abnormal cases. Is there a way to reproduce such a scenario in tests?


ManagedInterpreterGroup getInterpreterGroup(String groupId) {
if (groupId == null) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a warn log before returning in the null check so that this situation is more visible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Returning null could cause an NPE in the code currently calling this method (e.g., SessionConfInterpreter:53).
Therefore, I think it would be better to either not return null when groupId is null, or to modify the part that uses this method.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with your point, and I’d like to ask for a code update.
I found that ManagedInterpreterGroup getInterpreterGroup(String groupId) is used in two places: line 386 of InterpreterSettingManager.java and line 53 of SessionConfInterpreter.java.

In InterpreterSettingManager.java, null is already handled properly, but in SessionConfInterpreter.java it is not. Could you please update the code to handle null in that part as well?

@proceane
Copy link
Contributor Author

proceane commented Aug 24, 2025

@ParkGyeongTae Thanks for review.
In my case, the problem occurred when I set it as follows.

  1. When the ZeppelinServer shutdown method is executed, the shardServiceLocator.shutdown() method is executed.
  2. Set the value of the zeppelin.search.enable option to false in the Recovery Test (if this value is true, an error occurs first in LuceneSearch, so it cannot be reproduced)

If you set it up as above and run the recovery test, it seems that a problem occurs where the groupId is set to null in the interpreter setting section when restarting the server.
As I mentioned at the beginning, this doesn't usually happen.

Copy link
Contributor

@ParkGyeongTae ParkGyeongTae left a comment

Choose a reason for hiding this comment

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

I was able to reproduce this issue, and I confirmed that the changes fix the problem.

@ParkGyeongTae ParkGyeongTae self-assigned this Sep 6, 2025
@ParkGyeongTae ParkGyeongTae merged commit 078b754 into apache:master Sep 6, 2025
16 of 18 checks passed
ParkGyeongTae pushed a commit that referenced this pull request Sep 6, 2025
### What is this PR for?
This PR was created to prevent an error that occurs in the `InterpreterSetting.getInterpreterGroup` method when `groupId` is null and is retrieved from the Set.
Normally, the groupId parameter does not seem to be passed as null.
I found it when tested service shutdown(#4965).

### What type of PR is it?
Improvement

### Todos
* [x] - Add null check condition

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6282

### How should this be tested?

### Screenshots (if appropriate)

### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Closes #5026 from proceane/feature/ZEPPELIN-6282.

Signed-off-by: ParkGyeongTae <[email protected]>
(cherry picked from commit 078b754)
Signed-off-by: ParkGyeongTae <[email protected]>
@ParkGyeongTae
Copy link
Contributor

Merged into master and branch-0.12

@proceane proceane deleted the feature/ZEPPELIN-6282 branch September 18, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants