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-32034][SQL] Port HIVE-14817: Shutdown the SessionManager timeoutChecker thread properly upon shutdown #28870

Closed
wants to merge 3 commits into from

Conversation

yaooqinn
Copy link
Member

What changes were proposed in this pull request?

This PR port https://issues.apache.org/jira/browse/HIVE-14817 for spark thrift server.

Why are the changes needed?

When stopping the HiveServer2, the non-daemon thread stops the server from terminating

"HiveServer2-Background-Pool: Thread-79" #79 prio=5 os_prio=31 tid=0x00007fde26138800 nid=0x13713 waiting on condition [0x0000700010c32000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.apache.hive.service.cli.session.SessionManager$1.sleepInterval(SessionManager.java:178)
	at org.apache.hive.service.cli.session.SessionManager$1.run(SessionManager.java:156)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Here is an example to reproduce:
https://github.com/yaooqinn/kyuubi/blob/master/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/spark/SparkSQLEngineApp.scala

Also, it causes issues as HIVE-14817 described which

Does this PR introduce any user-facing change?

NO

How was this patch tested?

Passing Jenkins

@SparkQA
Copy link

SparkQA commented Jun 19, 2020

Test build #124277 has finished for PR 28870 at commit 1907832.

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

Copy link
Member

@wangyum wangyum left a comment

Choose a reason for hiding this comment

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

Do we need to backport to hive-1.2?

@yaooqinn yaooqinn changed the title [SPARK-32034][SQL] Port HIVE-14817: Shutdown the SessionManager timeoutChecker thread properly upon shutdown [SPARK-32034][SQL][test-hive1.2] Port HIVE-14817: Shutdown the SessionManager timeoutChecker thread properly upon shutdown Jun 19, 2020
@yaooqinn
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Jun 19, 2020

Test build #124292 has finished for PR 28870 at commit 756e084.

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

@SparkQA
Copy link

SparkQA commented Jun 19, 2020

Test build #124293 has finished for PR 28870 at commit 756e084.

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

timeoutCheckerLock.notify();
}
}

@Override
public synchronized void stop() {
super.stop();
shutdown = true;
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed because we did it in shutdownTimeoutChecker function.
HIVE-14817 removed this, too.

timeoutCheckerLock.notify();
}
}

@Override
public synchronized void stop() {
super.stop();
shutdown = true;
Copy link
Member

Choose a reason for hiding this comment

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

This should be removed because we did it in shutdownTimeoutChecker function.
HIVE-14817 removed this, too.

@dongjoon-hyun
Copy link
Member

dongjoon-hyun commented Jun 20, 2020

Gentle ping, @yaooqinn . :)

@yaooqinn
Copy link
Member Author

@dongjoon-hyun thanks for the check!

@SparkQA
Copy link

SparkQA commented Jun 21, 2020

Test build #124331 has finished for PR 28870 at commit 68a0c7b.

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

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-32034][SQL][test-hive1.2] Port HIVE-14817: Shutdown the SessionManager timeoutChecker thread properly upon shutdown [SPARK-32034][SQL] Port HIVE-14817: Shutdown the SessionManager timeoutChecker thread properly upon shutdown Jun 21, 2020
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you all.
Merged to master/3.0.

@dongjoon-hyun
Copy link
Member

BTW, @yaooqinn . Is this relevant to branch-2.4, too?

dongjoon-hyun pushed a commit that referenced this pull request Jun 21, 2020
…utChecker thread properly upon shutdown

### What changes were proposed in this pull request?

This PR port https://issues.apache.org/jira/browse/HIVE-14817 for spark thrift server.

### Why are the changes needed?

When stopping the HiveServer2, the non-daemon thread stops the server from terminating

```sql
"HiveServer2-Background-Pool: Thread-79" #79 prio=5 os_prio=31 tid=0x00007fde26138800 nid=0x13713 waiting on condition [0x0000700010c32000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at org.apache.hive.service.cli.session.SessionManager$1.sleepInterval(SessionManager.java:178)
	at org.apache.hive.service.cli.session.SessionManager$1.run(SessionManager.java:156)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
```

Here is an example to reproduce:
https://github.com/yaooqinn/kyuubi/blob/master/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/spark/SparkSQLEngineApp.scala

Also, it causes issues as HIVE-14817 described which

### Does this PR introduce _any_ user-facing change?
NO

### How was this patch tested?

Passing Jenkins

Closes #28870 from yaooqinn/SPARK-32034.

Authored-by: Kent Yao <yaooqinn@hotmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 9f8e15b)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@yaooqinn
Copy link
Member Author

BTW, @yaooqinn . Is this relevant to branch-2.4, too?

yes. need a followup?

@dongjoon-hyun
Copy link
Member

If you don't mind, could you make a backporting PR then?

@yaooqinn
Copy link
Member Author

OK

@dongjoon-hyun
Copy link
Member

Thank you!

dongjoon-hyun pushed a commit that referenced this pull request Jun 22, 2020
…timeoutChecker thread properly upon shutdown

### What changes were proposed in this pull request?

This PR backports #28870 which ports https://issues.apache.org/jira/browse/HIVE-14817 for spark thrift server.

### Why are the changes needed?

Port HIVE-14817 to fix related issues

### Does this PR introduce _any_ user-facing change?

no
### How was this patch tested?

passing Jenkins

Closes #28888 from yaooqinn/SPARK-32034-24.

Authored-by: Kent Yao <yaooqinn@hotmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@gatorsmile
Copy link
Member

cc @juliuszsompolski

@juliuszsompolski
Copy link
Contributor

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants