diff --git spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java index c4495a9..2837fa7 100644 --- spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java +++ spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java @@ -489,6 +489,7 @@ public void run() { runnable = new Runnable() { @Override public void run() { + String errMsg = "Exception while waiting for child process (spark-submit)"; try { int exitCode = child.waitFor(); if (exitCode != 0) { @@ -501,16 +502,18 @@ public void run() { } } - rpcServer.cancelClient(clientId, - "Child process exited before connecting back with error log " + errStr.toString()); LOG.warn("Child process exited with code {}", exitCode); + errMsg = "Child process (spark-submit) exited before connecting back with error log " + errStr.toString(); } } catch (InterruptedException ie) { - LOG.warn("Waiting thread interrupted, killing child process."); + LOG.warn("Thread waiting on the child process (spark-submit) is interrupted, killing the child process."); + errMsg = "Thread waiting on the child porcess (spark-submit) is interrupted"; Thread.interrupted(); child.destroy(); } catch (Exception e) { - LOG.warn("Exception while waiting for child process.", e); + LOG.warn(errMsg, e); + } finally { + rpcServer.cancelClient(clientId, errMsg); } } };