diff --git a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java index 5914236aee..1ac25f3599 100644 --- a/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java +++ b/shell/src/main/java/org/apache/zeppelin/shell/ShellInterpreter.java @@ -71,7 +71,11 @@ public class ShellInterpreter extends KerberosInterpreter { for (String executorKey : executors.keySet()) { DefaultExecutor executor = executors.remove(executorKey); if (executor != null) { - executor.getWatchdog().destroyProcess(); + try { + executor.getWatchdog().destroyProcess(); + } catch (Exception e){ + LOGGER.error("error destroying executor for paragraphId: " + executorKey, e); + } } } } @@ -126,7 +130,11 @@ public class ShellInterpreter extends KerberosInterpreter { public void cancel(InterpreterContext context) { DefaultExecutor executor = executors.remove(context.getParagraphId()); if (executor != null) { - executor.getWatchdog().destroyProcess(); + try { + executor.getWatchdog().destroyProcess(); + } catch (Exception e){ + LOGGER.error("error destroying executor for paragraphId: " + context.getParagraphId(), e); + } } } @@ -157,6 +165,7 @@ public class ShellInterpreter extends KerberosInterpreter { try { ShellSecurityImpl.createSecureConfiguration(getProperty(), shell); } catch (Exception e) { + LOGGER.error("Unable to run kinit for zeppelin", e); return false; } return true; diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/KerberosInterpreter.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/KerberosInterpreter.java index 51ae617fe6..8984f28aec 100644 --- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/KerberosInterpreter.java +++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/KerberosInterpreter.java @@ -31,10 +31,6 @@ import org.slf4j.LoggerFactory; /** * Interpreter wrapper for Kerberos initialization * - * TODO: coming soon - * Please see, - * https://zeppelin.apache.org/docs/latest/development/writingzeppelininterpreter.html - * * runKerberosLogin() method you need to implement that determine Zeppelin's behavior. * startKerberosLoginThread() needs to be called inside the open() and * shutdownExecutorService() inside close(). @@ -101,8 +97,11 @@ public abstract class KerberosInterpreter extends Interpreter { scheduledExecutorService .schedule(this, getTimeAsMs(getKerberosRefreshInterval()), TimeUnit.MILLISECONDS); } else { + kinitFailCount++; + logger.info("runKerberosLogin failed for " + kinitFailCount + "time"); // schedule another retry at once or close the interpreter if too many times kinit fails if (kinitFailCount >= kinitFailThreshold()) { + logger.error("runKerberosLogin failed for max attempts, calling close interpreter."); close(); } else { scheduledExecutorService.submit(this);