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

[ZEPPELIN-3928] Fix bugs AngularBind operation NullPointerException #3276

Closed
wants to merge 2 commits into from

Conversation

xunliu
Copy link
Member

@xunliu xunliu commented Dec 29, 2018

What is this PR for?

In the case where the note does not start the interpreter process, Direct use of the z.angularBind operation will have a null pointer exception.

What type of PR is it?

[Bug Fix]

Todos

  • Fix the condition for judging the interpreter process when the note is used for angularBind.

What is the Jira issue?

What Test

Create a new paragraph to display angularBind variables

%angular
<h2>this : {{COMMAND_TYPE}}</h2>

Create a new paragraph to bind variables

<form class="form-inline">
  <div class="form-group">
    <label for="superheroId">Super Hero: </label>
    <input type="text" class="form-control" id="superheroId" placeholder="Superhero name ..." ng-model="superhero"></input>
  </div>
  <button type="submit" class="btn btn-primary" ng-click="z.angularBind('COMMAND_TYPE',superhero,'paragraph_1545881601069_1553190230');"> Bind</button>
</form>

How should this be tested?

CI pass

Screenshots (if appropriate)

Before fixing BUG
alt text

After fixing the bug
alt text

Questions:

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

…hen the interpreter is not started

### What is this PR for?

In the case where the note does not start the interpreter process, Direct use of the z.angularBind operation will have a null pointer exception.

### What type of PR is it?
[Bug Fix]

### Todos
* [x] Fix the condition for judging the interpreter process when the note is used for angularBind.
* [x] Optimize the execution efficiency of the NotebookServer::onUpdate(...) function.

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

### How should this be tested?
CI pass

### Screenshots (if appropriate)

![alt text](https://github.com/liuxunorg/images/blob/master/zeppelin/angularBing-bug.gif?raw=true "angularBing-bug.gif")

![alt text](https://github.com/liuxunorg/images/blob/master/zeppelin/angularBing-bugfix.gif?raw=true "angularBing-bugfix.gif")

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
@xunliu xunliu changed the title [ZEPPELIN-3928] Fix bugs AngularBind operation NullPointerException when the interpreter is not started [ZEPPELIN-3928] Fix bugs AngularBind operation NullPointerException Dec 29, 2018
Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

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

thanks for all the details in the description.

it looks like there are two separate fixes here? what's the condition to reach object.getNoteId() == null?

continue;
}

Note note = getNotebook().getNote(object.getNoteId());
Copy link
Member Author

Choose a reason for hiding this comment

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

Judge object.getNoteId() == null Is to prevent Note note = getNotebook().getNote(object.getNoteId()); exception

Copy link
Member

Choose a reason for hiding this comment

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

I'm actually not sure why it wasn't doing getNotebook().getNote(note id) before @jongyoul @zjffdu ?

Copy link
Member Author

Choose a reason for hiding this comment

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

object.getNoteId() == null, Can also not add this code, Just to be safer, Or do I cancel this judgment code?

@xunliu
Copy link
Member Author

xunliu commented Jan 4, 2019

@felixcheung , @jongyoul , @zjffdu, Please help me review code. Thanks! :-)

@xunliu
Copy link
Member Author

xunliu commented Jan 5, 2019

@felixcheung , I revert Optimize the execution efficiency of the NotebookServer::onUpdate(...) function. And CI Pass https://travis-ci.org/liuxunorg/zeppelin/builds/475618439

@zjffdu
Copy link
Contributor

zjffdu commented Jan 24, 2019

+1, Will merge if no more comments Thanks @liuxunorg

@asfgit asfgit closed this in 51ba193 Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants