capturing stacktrace when exception occur in JVM & setting app name

This commit is contained in:
skaarthik 2015-11-04 14:43:46 -08:00
Родитель 07ca1ac69a
Коммит 0641232c61
3 изменённых файлов: 20 добавлений и 2 удалений

Просмотреть файл

@ -61,7 +61,11 @@ namespace Microsoft.Spark.CSharp.Interop.Ipc
//TODO - add boolean instead of int in the backend
if (isMethodCallFailed != 0)
{
throw new Exception("Method execution failed"); //TODO - add more info to the exception
var jvmFullStackTrace = socket.ReadString();
const string errorMessage = @"JVM method execution failed";
logger.LogError(errorMessage);
logger.LogError(jvmFullStackTrace);
throw new Exception(errorMessage);
}
var typeAsChar = socket.ReadChar();

Просмотреть файл

@ -131,10 +131,18 @@ class CSharpBackendHandler(server: CSharpBackend) extends SimpleChannelInboundHa
}
} catch {
case e: Exception =>
logError(s"$methodName on $objId failed", e)
//TODO - logError does not work now..fix //logError(s"$methodName on $objId failed", e)
val jvmObj = JVMObjectTracker.get(objId)
val jvmObjName = jvmObj match
{
case Some(jObj) => jObj.getClass.getName
case None => "NullObject"
}
println(s"$methodName on object of type $jvmObjName failed")
println(e.getMessage)
println(e.printStackTrace())
writeInt(dos, -1)
writeString(dos, Utils.exceptionString(e.getCause))
}
}

Просмотреть файл

@ -116,6 +116,12 @@ object SparkCLRSubmit {
System.setProperty(key, value)
}
//override spark.app.name with C# driver name to differentiate apps in SparkUI
//without override, app name is set to org.apache.spark.deploy.csharp.SparkCLRSubmit
var appName = new File(childArgs(0)).getName
println("overriding spark.app.name to " + appName)
System.setProperty("spark.app.name", appName)
var mainClass: Class[_] = null
try {