-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-2627] Interpreter Component Refactoring #2554
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
Conversation
|
I can see some test cases are removed or commented out. for example zeppelin-zengine/src/test/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterTest.java and some other places. Is it intended or work in progress? |
6601c80 to
b6065d9
Compare
| tmpDir.mkdirs(); | ||
| fileChanged = null; | ||
| numChanged = 0; | ||
| numChanged = new AtomicInteger(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix flaky test
| INTERPRETER_SCRIPT, "nonexists", "fakeRepo", new HashMap<String, String>(), | ||
| 10 * 1000, null, null,"fakeName"); | ||
| assertFalse(rip.isRunning()); | ||
| assertEquals(0, rip.referenceCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These kinds of testing is not needed any more because of refactoring
| private DependencyResolver depResolver; | ||
|
|
||
| @Before | ||
| public void setUp() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the test here is covered by InterpreterSettingTest & InterpreterSettingManagerTest
b6065d9 to
ad096e8
Compare
|
@Leemoonsoo I add more comments for the test case. Some testcase is not needed any more |
ad096e8 to
4b6223d
Compare
|
@Leemoonsoo Do you mind if I commit it first to continue other works ? |
|
Let me test this branch little more with some edge cases. |
| if (job.isAborted()) { | ||
| job.setStatus(Status.ABORT); | ||
| } else if (job.getException() != null) { | ||
| // logger.info("Job ABORT, " + job.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shell we remove or change to logger.debug?
| * @throws Exception | ||
| */ | ||
| @Test | ||
| public void testRestartInterpreterInScopedMode() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zjffdu Could you point new testcase covers this case?
InterpreterSettingManagerTest looks like have related testcase but somehow restart behavior in scoped mode seems changed. try
- set an interpreter scoped mode per note
- create two notes and start a paragraph in each note
- Restart intepreter from a note in 'interpreter-binding' menu (not in interpreter menu)
Interpreter supposed to be restart for a note only, but it restarts interpreter for both notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, those tests suppose to ensure restart behavior from note page.
However, if I try this by hands, I'm getting different behavior explained above.
Could you take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo I believe this is the current behavior of zeppelin, not caused by this PR. Not sure why we would close all interpreter when it is anonymous. See
https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSettingManager.java#L971
If you feel OK, I will change the behavior in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I have tested master branch with shiro configured and this branch without shiro.
I also not sure why close all interpreter when it is anonymous.
It's up to you change the behavior in this PR or not, but maybe handle it in separate PR for future reference?
| * @throws Exception | ||
| */ | ||
| @Test | ||
| public void testRestartInterpreterInIsolatedMode() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like testRestartInterpreterInScopedMode() restart behavior protected by this unittest has changed.
We'll need to bring this testcase back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| @Test | ||
| public void testMultiUser() throws IOException, RepositoryException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an equivalent test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| @Test | ||
| public void registerCustomInterpreterRunner() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an equivalent test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
|
|
||
| @Test | ||
| public void getEditorSetting() throws IOException, RepositoryException, SchedulerException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an equivalent test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3a606ee to
b837800
Compare
|
Thanks @zjffdu for great work. |
|
Thanks @Leemoonsoo for the review, I will merge it if no more comments. And will do the change in the following PR as there's still remaining work for the refactoring. |
b837800 to
fa0d435
Compare
### What is this PR for? Fixed the bug mentioned in #2554 (comment) ### What type of PR is it? [Bug Fix] ### Todos * [ ] - Task ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-2998 ### How should this be tested? * Unit test is added ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Jeff Zhang <zjffdu@apache.org> Closes #2626 from zjffdu/ZEPPELIN-2998 and squashes the following commits: cc11fb6 [Jeff Zhang] ZEPPELIN-2998. Fix bug in restarting interpreter in scoped mode
|
@zjffdu Just found out an issue which is a side effect of this PR, now I cannot delete an interpreter. |
|
hmm, I see. Because every time I will merge interpreter-setting.json into interpreter-setting.json. Mind to create a ticket ? I will fix it. |
|
Sure here you go ZEPPELIN-3029 |
What is this PR for?
I didn't intended to make such large change at the beginning, but found many things are coupled together that I have to make such large change. Several suggestions for you how to review and read it.
I move the interpreter package from zeppelin-zengine to zeppelin-interpreter, this is needed for this refactoring.
The overall change is the same as I described in the design doc. I would suggest you to read the unit test first. These unit test is very readable and easy to understand what the code is doing now.
InterpreterFactoryTest,InterpreterGroupTest,InterpreterSettingTest,InterpreterSettingManagerTest,RemoteInterpreterTest.Remove the referent counting logic. Now I will kill the interpreter process as long as all the sessions in the same interpreter group is closed. (I plan to add another kind of policy for the interpreter process lifecycle control, ZEPPELIN-2197)
The RemoteFunction I introduced is for reducing code duplicates when we use RPC.
The changes in
Job.javaandRemoteScheduleris for fixing the race issue bug. This bug cause the flaky test we see often inZeppelinSparkClusterTest.pySparkTestWhat type of PR is it?
[Bug Fix | Refactoring]
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-2627
How should this be tested?
Unit test is added
Screenshots (if appropriate)
Questions:
Does the licenses files need update? No
Is there breaking changes for older versions? No
Does this needs documentation? No