HIVE-14714: Avoid misleading "java.io.IOException: Stream closed" when shutting down HoS (Gabor Szadovszky via Rui)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/96508d34 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/96508d34 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/96508d34 Branch: refs/heads/hive-14535 Commit: 96508d341fbae4d9ff4268bdcff4849893d9c277 Parents: 62c45de Author: Gabor Szadovszky <[email protected]> Authored: Wed Sep 21 16:17:07 2016 +0800 Committer: Rui Li <[email protected]> Committed: Wed Sep 21 16:17:07 2016 +0800 ---------------------------------------------------------------------- .../java/org/apache/hive/spark/client/SparkClientImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/96508d34/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java ---------------------------------------------------------------------- diff --git a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java index e8ca42a..936fdaf 100644 --- a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java +++ b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java @@ -621,6 +621,14 @@ class SparkClientImpl implements SparkClient { } } } + } catch (IOException e) { + if (isAlive) { + LOG.warn("I/O error in redirector thread.", e); + } else { + // When stopping the remote driver the process might be destroyed during reading from the stream. + // We should not log the related exceptions in a visible level as they might mislead the user. + LOG.debug("I/O error in redirector thread while stopping the remote driver", e); + } } catch (Exception e) { LOG.warn("Error in redirector thread.", e); }
