소스 검색

[livy] Ignore IOExceptions when shutting python down

Erick Tryzelaar 11 년 전
부모
커밋
38194ff
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      apps/spark/java/livy-repl/src/main/scala/com/cloudera/hue/livy/repl/python/PythonInterpreter.scala

+ 7 - 2
apps/spark/java/livy-repl/src/main/scala/com/cloudera/hue/livy/repl/python/PythonInterpreter.scala

@@ -227,8 +227,13 @@ private class PythonInterpreter(process: Process, gatewayServer: GatewayServer)
               case None =>
             }
 
-            process.getInputStream.close()
-            process.getOutputStream.close()
+            // Ignore IO errors, such as if the stream is already closed.
+            try {
+              process.getInputStream.close()
+              process.getOutputStream.close()
+            } catch {
+              case _: IOException =>
+            }
 
             try {
               process.destroy()