소스 검색

[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 년 전
부모
커밋
0e7ac154fe
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) {