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

[SPARK-20173][SQL][hive-thriftserver] Throw NullPointerException when HiveThriftServer2 is shutdown #17496

Closed

Conversation

zuotingbing
Copy link

@zuotingbing zuotingbing commented Mar 31, 2017

What changes were proposed in this pull request?

If the shutdown hook called before the variable uiTab is set , it will throw a NullPointerException.

How was this patch tested?

manual tests

@@ -82,7 +82,9 @@ object HiveThriftServer2 extends Logging {

ShutdownHookManager.addShutdownHook { () =>
SparkSQLEnv.stop()
uiTab.foreach(_.detach())
if (uiTab != null) {
uiTab.foreach(_.detach())
Copy link
Member

Choose a reason for hiding this comment

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

I think it's easier to just init the Option to None instead of _ which is null.

Copy link
Author

Choose a reason for hiding this comment

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

Yes of course.
OK, i'll change it as you suggested. Thanks a lot.

@SparkQA
Copy link

SparkQA commented Apr 1, 2017

Test build #3630 has finished for PR 17496 at commit 5ae5f4d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Apr 2, 2017

Merged to master

@asfgit asfgit closed this in 657cb95 Apr 2, 2017
@zuotingbing zuotingbing deleted the SPARK-HiveThriftServer2 branch April 6, 2017 09:23
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.

3 participants