Explorar o código

[livy] Ignore IOExceptions when shutting python down

Erick Tryzelaar %!s(int64=10) %!d(string=hai) anos
pai
achega
38194ff

+ 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()