Ngone51 commented on a change in pull request #27724: [SPARK-30973][SQL]
ScriptTransformationExec should wait for the termination …
URL: https://github.com/apache/spark/pull/27724#discussion_r407945243
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala
##########
@@ -146,12 +148,32 @@ case class ScriptTransformationExec(
}
}
+ private def waitForTransformationProcessTermination(): Unit = {
+ val timeout =
SQLConf.get.getConf(SQLConf.TRANSFORMATION_EXIT_TIMEOUT)
+ try {
+ if (timeout < 0) {
+ proc.waitFor()
+ } else if (timeout == 0) {
+ // Do nothing
+ } else {
+ proc.waitFor(timeout, TimeUnit.SECONDS)
+ }
Review comment:
I feel that the logic here is too complex. It really does not make sense to
allow user to set 0 timeout which could introduce the potential bug again. Also
negative timeout may cause app hang, which breaks our initial motivation to
introduce this conf (which is to avoid app hang).
Thus, I think we should consider the `timeout > 0` case only and add
`checkValue(timeout > 0)` to the conf and simplify the code here.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]