-
Notifications
You must be signed in to change notification settings - Fork 980
Support query auto timeout cancel on thriftserver #451
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
|
|
||
| package org.apache.kyuubi.engine.spark | ||
|
|
||
| object Constants { |
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.
We should define kyuubi.server.query.timeout at the server-side rather than the engine-side.
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.
Users can't infer time unit from kyuubi.server.query.timeout, and there are some configurations defined in second and others defined in millisecond, should we make the configuration name more clear?
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.
@pan3793
I see the point, but the exists conf already named with *.timeout.. How about enhance the kyuubi-defaults.conf.template ? I guess it's useful if we write some common config into it.
Codecov Report
@@ Coverage Diff @@
## master #451 +/- ##
==========================================
+ Coverage 80.67% 80.82% +0.15%
==========================================
Files 109 109
Lines 3871 3907 +36
Branches 460 465 +5
==========================================
+ Hits 3123 3158 +35
Misses 504 504
- Partials 244 245 +1
Continue to review full report at Codecov.
|
| } | ||
| } | ||
|
|
||
| test("SPARK-26533: Support query auto timeout cancel on thriftserver - setQueryTimeout") { |
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.
we need to move these tests to the superclass to test both the server and engine.
|
|
||
| // If a timeout value `queryTimeout` is specified by users and it is smaller than | ||
| // a global timeout value, we use the user-specified value. | ||
| // This code follows the Hive timeout behaviour (See #29933 for details). |
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.
how about replace #29933 by SPARK-26533?
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
Outdated
Show resolved
Hide resolved
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
Outdated
Show resolved
Hide resolved
kyuubi-main/src/main/scala/org/apache/kyuubi/operation/ExecuteStatement.scala
Outdated
Show resolved
Hide resolved
...rk-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/ExecuteStatement.scala
Show resolved
Hide resolved
|
a local test run is needed when new configs are comming |
| import org.apache.kyuubi.config.KyuubiConf | ||
| import org.apache.kyuubi.operation.JDBCTestUtils | ||
|
|
||
| class SparkEngineSuites extends KyuubiFunSuite { |
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.
This new test class is for easily test which need modify the global config.
| .createWithDefault(true) | ||
|
|
||
| val OPERATION_QUERY_TIMEOUT: ConfigEntry[Long] = | ||
| buildConf("operation.query.timeout") |
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.
Decide to hide the Spark thing that in SparkThriftServer, so define the config with Kyuubi style @pan3793
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.
I think Kyuubi style timeConf defined in ms? The comments here is in seconds.
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.
Actually, I think we don't need to specific time unit in kyuubi timeConf style, user should not care about what we use internal, they just define it via ISO-8601 duration string
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.
Sorry, I missed this comment. What @pan3793 pointed out is true, we don't need to tell the unit of a time conf, it's Duration ISO-8601 strings..
Here is a bug at caller side! the client timeout is conf, and the system timeout is ms... @ulysses-you
|
After the refector, provide some summary for reviewer:
|
kyuubi-main/src/main/scala/org/apache/kyuubi/operation/KyuubiOperationManager.scala
Outdated
Show resolved
Hide resolved
kyuubi-main/src/main/scala/org/apache/kyuubi/operation/KyuubiOperationManager.scala
Outdated
Show resolved
Hide resolved
kyuubi-main/src/main/scala/org/apache/kyuubi/operation/KyuubiOperationManager.scala
Outdated
Show resolved
Hide resolved
kyuubi-main/src/main/scala/org/apache/kyuubi/operation/KyuubiOperationManager.scala
Outdated
Show resolved
Hide resolved
...rk-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/ExecuteStatement.scala
Outdated
Show resolved
Hide resolved
kyuubi-main/src/main/scala/org/apache/kyuubi/operation/KyuubiOperationManager.scala
Outdated
Show resolved
Hide resolved
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
Outdated
Show resolved
Hide resolved
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
Outdated
Show resolved
Hide resolved
kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
Outdated
Show resolved
Hide resolved
yaooqinn
left a comment
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.
LGTM, if the test flakiness fixed
 [](https://github.com/yaooqinn/kyuubi/pull/451)       [<img width="16" alt="Powered by Pull Request Badge" src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=yaooqinn&utm_campaign=badge_info)<!-- PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT --> <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html 2. If the PR is related to an issue in https://github.com/yaooqinn/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'. 3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'. --> ### _Why are the changes needed?_ <!-- Please clarify why the changes are needed. For instance, 1. If you add a feature, you can talk about the use case of it. 2. If you fix a bug, you can clarify why it is a bug. --> Manual cherry-pick some Spark patch into Kyuubi. 1. [Support query auto timeout cancel on thriftserver](apache/spark#29933) 2. [Add config to control if cancel invoke interrupt task on thriftserver](apache/spark#30481) In order to keep backward with early Spark version, we hard code the config key instead of refer to Spark SQLConf. Note that, the exists timeout of operator (`kyuubi.operation.idle.timeout`) is to cancel that client has no access with engine. That said if a query run a long time and the client is alive, the query would not be cancelled. Then the new added config `spark.sql.thriftServer.queryTimeout` can handle this case. ### _How was this patch tested?_ Add new test. Closes #451 from ulysses-you/query-timeout. 212f579 [ulysses-you] docs 9206538 [ulysses-you] empty flaky test ddab9bf [ulysses-you] flaty test 1da02a0 [ulysses-you] flaty test edfadf1 [ulysses-you] nit 3f9920b [ulysses-you] address comment 9492c48 [ulysses-you] correct timeout 5df997e [ulysses-you] nit 2124952 [ulysses-you] address comment 192fdcc [ulysses-you] fix tets d684af6 [ulysses-you] global config 1d1adda [ulysses-you] empty 967a63e [ulysses-you] correct import 128948e [ulysses-you] add session conf in session 144d51b [ulysses-you] fix a90248b [ulysses-you] unused import c90386f [ulysses-you] timeout move to operation manager d780965 [ulysses-you] update docs a5f7138 [ulysses-you] fix test f7c7308 [ulysses-you] config name 7f3fb3d [ulysses-you] change conf place 97a011e [ulysses-you] unnecessary change 0953a76 [ulysses-you] move test 38ac0c0 [ulysses-you] Merge branch 'master' of https://github.com/yaooqinn/kyuubi into query-timeout 71bea97 [ulysses-you] refector implementation 35ef6f9 [ulysses-you] update conf 0cad8e2 [ulysses-you] Support query auto timeout cancel on thriftserver Authored-by: ulysses-you <[email protected]> Signed-off-by: Kent Yao <[email protected]> (cherry picked from commit fecdba3) Signed-off-by: Kent Yao <[email protected]>
|
thanks, merged to master for v1.2.0 and branch 1.1 for v1.1.1 |
Why are the changes needed?
Manual cherry-pick some Spark patch into Kyuubi.
In order to keep backward with early Spark version, we hard code the config key instead of refer to Spark SQLConf.
Note that, the exists timeout of operator (
kyuubi.operation.idle.timeout) is to cancel that client has no access with engine. That said if a query run a long time and the client is alive, the query would not be cancelled. Then the new added configspark.sql.thriftServer.queryTimeoutcan handle this case.How was this patch tested?
Add new test.