liaoaoyuan97 commented on a change in pull request #21164:
URL: https://github.com/apache/spark/pull/21164#discussion_r486793639



##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala
##########
@@ -137,13 +137,12 @@ case class ScriptTransformationExec(
             throw writerThread.exception.get
           }
 
-          if (!proc.isAlive) {
-            val exitCode = proc.exitValue()
-            if (exitCode != 0) {
-              logError(stderrBuffer.toString) // log the stderr circular buffer
-              throw new SparkException(s"Subprocess exited with status 
$exitCode. " +
-                s"Error: ${stderrBuffer.toString}", cause)
-            }
+          proc.waitFor()

Review comment:
       @viirya In the proposed PR, proc.waitFor() is called within function 
checkFailureAndPropagate. Basically, proc is terminated before any 
checkFailureAndPropagate call returns. Do you mean that we should not waitfor 
proc before other CheckFailureAndPropagate calls but the case you mentioned?

##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala
##########
@@ -137,13 +137,12 @@ case class ScriptTransformationExec(
             throw writerThread.exception.get
           }
 
-          if (!proc.isAlive) {
-            val exitCode = proc.exitValue()
-            if (exitCode != 0) {
-              logError(stderrBuffer.toString) // log the stderr circular buffer
-              throw new SparkException(s"Subprocess exited with status 
$exitCode. " +
-                s"Error: ${stderrBuffer.toString}", cause)
-            }
+          proc.waitFor()

Review comment:
       @viirya In the proposed PR, proc.waitFor() is called within function 
checkFailureAndPropagate. Basically, proc is terminated before any 
checkFailureAndPropagate call returns. Do you mean that we should not waitfor 
proc before other CheckFailureAndPropagate calls but the case you mentioned?

##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala
##########
@@ -137,13 +137,12 @@ case class ScriptTransformationExec(
             throw writerThread.exception.get
           }
 
-          if (!proc.isAlive) {
-            val exitCode = proc.exitValue()
-            if (exitCode != 0) {
-              logError(stderrBuffer.toString) // log the stderr circular buffer
-              throw new SparkException(s"Subprocess exited with status 
$exitCode. " +
-                s"Error: ${stderrBuffer.toString}", cause)
-            }
+          proc.waitFor()

Review comment:
       @viirya In the proposed PR, proc.waitFor() is called within function 
checkFailureAndPropagate. Basically, proc is terminated before any 
checkFailureAndPropagate call returns. Do you mean that we should not waitfor 
proc before other CheckFailureAndPropagate calls but the case you mentioned?

##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala
##########
@@ -137,13 +137,12 @@ case class ScriptTransformationExec(
             throw writerThread.exception.get
           }
 
-          if (!proc.isAlive) {
-            val exitCode = proc.exitValue()
-            if (exitCode != 0) {
-              logError(stderrBuffer.toString) // log the stderr circular buffer
-              throw new SparkException(s"Subprocess exited with status 
$exitCode. " +
-                s"Error: ${stderrBuffer.toString}", cause)
-            }
+          proc.waitFor()

Review comment:
       @viirya In the proposed PR, proc.waitFor() is called within function 
checkFailureAndPropagate. Basically, proc is terminated before any 
checkFailureAndPropagate call returns. Do you mean that we should not waitfor 
proc before other CheckFailureAndPropagate calls but the case you mentioned?

##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala
##########
@@ -137,13 +137,12 @@ case class ScriptTransformationExec(
             throw writerThread.exception.get
           }
 
-          if (!proc.isAlive) {
-            val exitCode = proc.exitValue()
-            if (exitCode != 0) {
-              logError(stderrBuffer.toString) // log the stderr circular buffer
-              throw new SparkException(s"Subprocess exited with status 
$exitCode. " +
-                s"Error: ${stderrBuffer.toString}", cause)
-            }
+          proc.waitFor()

Review comment:
       @viirya In the proposed PR, proc.waitFor() is called within function 
checkFailureAndPropagate. Basically, proc is terminated before any 
checkFailureAndPropagate call returns. Do you mean that we should not waitfor 
proc before other CheckFailureAndPropagate calls but the case you mentioned?




----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to