You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/12/07 05:34:44 UTC
[GitHub] [spark] ulysses-you commented on a change in pull request #30481: [SPARK-33526][SQL] Add config to control if cancel invoke interrupt task on thriftserver
ulysses-you commented on a change in pull request #30481:
URL: https://github.com/apache/spark/pull/30481#discussion_r537242559
##########
File path: sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerWithSparkContextSuite.scala
##########
@@ -79,6 +84,45 @@ trait ThriftServerWithSparkContextSuite extends SharedThriftServer {
"java.lang.NumberFormatException: invalid input syntax for type numeric: 1.2"))
}
}
+
+ test("SPARK-33526: Add config to control if cancel invoke interrupt task on thriftserver") {
+ withJdbcStatement { statement =>
+ val forceCancel = new AtomicBoolean(false)
+ val listener = new SparkListener {
+ override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = {
+ taskEnd.reason match {
+ case _: TaskKilled =>
+ if (forceCancel.get()) {
+ assert(System.currentTimeMillis() - taskEnd.taskInfo.launchTime < 1000)
+ } else {
+ assert(System.currentTimeMillis() - taskEnd.taskInfo.launchTime >= 2900)
Review comment:
Without this PR, the comparison `running time of forceCancel=false` also can langer than `running time of forceCancel=true` due to accuracy. How about check 2s ? I believe it is stable enough.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org