diff --git a/rsc/src/main/java/org/apache/livy/rsc/ContextLauncher.java b/rsc/src/main/java/org/apache/livy/rsc/ContextLauncher.java index c59136d55..07fe7883d 100644 --- a/rsc/src/main/java/org/apache/livy/rsc/ContextLauncher.java +++ b/rsc/src/main/java/org/apache/livy/rsc/ContextLauncher.java @@ -397,11 +397,11 @@ public void run() { fail(new IOException(String.format("Child process exited with code %d.", exitCode))); } } catch (InterruptedException ie) { - LOG.warn("Waiting thread interrupted, killing child process."); + LOG.error("Waiting thread interrupted, killing child process.", ie); Thread.interrupted(); child.destroy(); } catch (Exception e) { - LOG.warn("Exception while waiting for child process.", e); + LOG.error("Exception while waiting for child process.", e); } finally { RSCClientFactory.childProcesses().decrementAndGet(); } @@ -436,7 +436,7 @@ public void detach() { try { monitor.join(conf.getTimeAsMs(CLIENT_SHUTDOWN_TIMEOUT)); } catch (InterruptedException ie) { - LOG.debug("Interrupted before driver thread was finished."); + LOG.error("Interrupted before driver thread was finished.", ie); } } diff --git a/rsc/src/main/java/org/apache/livy/rsc/driver/SparkEntries.java b/rsc/src/main/java/org/apache/livy/rsc/driver/SparkEntries.java index 6726bb1ab..e6f2efb2c 100644 --- a/rsc/src/main/java/org/apache/livy/rsc/driver/SparkEntries.java +++ b/rsc/src/main/java/org/apache/livy/rsc/driver/SparkEntries.java @@ -85,7 +85,7 @@ public SparkSession sparkSession() { LOG.info("Created Spark session."); } } catch (Exception e) { - LOG.warn("SparkSession is not supported", e); + LOG.error("SparkSession is not supported", e); throw e; } } diff --git a/rsc/src/main/java/org/apache/livy/rsc/rpc/Rpc.java b/rsc/src/main/java/org/apache/livy/rsc/rpc/Rpc.java index 5fce16410..c761d6936 100644 --- a/rsc/src/main/java/org/apache/livy/rsc/rpc/Rpc.java +++ b/rsc/src/main/java/org/apache/livy/rsc/rpc/Rpc.java @@ -315,7 +315,7 @@ private void handleCall(ChannelHandlerContext ctx, Object msg, Class handleCl } writeMessage(MessageType.REPLY, payload); } catch (InvocationTargetException ite) { - LOG.debug(String.format("[%s] Error in RPC handler.", name()), ite.getCause()); + LOG.warn(String.format("[%s] Error in RPC handler.", name()), ite.getCause()); writeMessage(MessageType.ERROR, Utils.stackTraceAsString(ite.getCause())); } } diff --git a/server/src/main/scala/org/apache/livy/utils/SparkYarnApp.scala b/server/src/main/scala/org/apache/livy/utils/SparkYarnApp.scala index dd551c20b..8d61ed28c 100644 --- a/server/src/main/scala/org/apache/livy/utils/SparkYarnApp.scala +++ b/server/src/main/scala/org/apache/livy/utils/SparkYarnApp.scala @@ -272,6 +272,7 @@ class SparkYarnApp private[utils] ( } } catch { case e: Exception => + error("Get application info error ", e) appIdPromise.failure(e) throw e } @@ -329,6 +330,7 @@ class SparkYarnApp private[utils] ( } catch { // This exception might be thrown during app is starting up. It's transient. case e: ApplicationAttemptNotFoundException => + debug("Encountered ApplicationAttemptNotFoundException. ", e) // Workaround YARN-4411: No enum constant FINAL_SAVING from getApplicationAttemptReport() case e: IllegalArgumentException => if (e.getMessage.contains("FINAL_SAVING")) { diff --git a/thriftserver/server/src/main/scala/org/apache/livy/thriftserver/LivyThriftSessionManager.scala b/thriftserver/server/src/main/scala/org/apache/livy/thriftserver/LivyThriftSessionManager.scala index 03e10c35a..0a2c8f7a0 100644 --- a/thriftserver/server/src/main/scala/org/apache/livy/thriftserver/LivyThriftSessionManager.scala +++ b/thriftserver/server/src/main/scala/org/apache/livy/thriftserver/LivyThriftSessionManager.scala @@ -100,7 +100,8 @@ class LivyThriftSessionManager(val server: LivyThriftServer, val livyConf: LivyC } else { future.value match { case Some(Success(session)) => session - case Some(Failure(e)) => throw Option(e.getCause).getOrElse(e) + // It can`t be e.getCause because we need know the specific reason! + case Some(Failure(e)) => e case None => throw new RuntimeException("Future cannot be None when it is completed") } }