Преглед на файлове

[livy] Synchronize the spark interpreter when shutting down

This prevents clients from trying to execute commands while
the interpreter is shutting down.
Erick Tryzelaar преди 10 години
родител
ревизия
0e7ac15
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      apps/spark/java/livy-repl/src/main/scala/com/cloudera/hue/livy/repl/scala/interpreter/Interpreter.scala

+ 1 - 1
apps/spark/java/livy-repl/src/main/scala/com/cloudera/hue/livy/repl/scala/interpreter/Interpreter.scala

@@ -123,7 +123,7 @@ class Interpreter {
     result
   }
 
-  def shutdown(): Unit = {
+  def shutdown(): Unit = synchronized {
     _state = Interpreter.ShuttingDown()
 
     if (sparkContext != null) {