Hi,

I'm working on issue https://issues.apache.org/jira/browse/ZEPPELIN-1856 and I 
found that we receive a NullPointerException sometimes because a paragraph 
result is cleared twice when we run a job. First Paragraph.result is cleared 
just before running RemoteInterpreter.interpret(..) and this is ok. But then we 
receive an OUTPUT_UPDATE_ALL event from the RemoteInterpreterServer and set 
Paragraph.result to null again that may lead to a NullPointerException if 
Paragraph.result was already filled by RemoteInterpreter.interpret(..) responce.

To resolve this problem we need to remove 
note.clearParagraphOutput(paragraphId) line from the onOutputClear() method in 
NotebookServer.java class:

@Override
public void onOutputClear(String noteId, String paragraphId) {
    Notebook notebook = notebook();
    final Note note = notebook.getNote(noteId);
    note.clearParagraphOutput(paragraphId);    // this line seems to be wrong
    Paragraph paragraph = note.getParagraph(paragraphId);
    broadcastParagraph(note, paragraph);
}

This method is called only when RemoteInterpreterServer.interpret(..) 
initializes an InterpreterContext and sends an OUTPUT_UPDATE_ALL event.
Is it safe to remove this line or I miss something? It was added by 
https://github.com/apache/zeppelin/pull/1658.

Thanks,
Alexander

Reply via email to