[hotfix] Fix error messages in EnvironmentInformation when accessing user information
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/84b39dcb Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/84b39dcb Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/84b39dcb Branch: refs/heads/master Commit: 84b39dcb50167368d45882a88842760237fa3560 Parents: b0b0cb5 Author: Stephan Ewen <[email protected]> Authored: Mon Jul 13 16:27:01 2015 +0200 Committer: Stephan Ewen <[email protected]> Committed: Mon Jul 13 17:54:31 2015 +0200 ---------------------------------------------------------------------- .../apache/flink/runtime/util/EnvironmentInformation.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/84b39dcb/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java b/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java index 736b2b5..dde422b 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java @@ -89,10 +89,14 @@ public class EnvironmentInformation { try { return UserGroupInformation.getCurrentUser().getShortUserName(); } + catch (LinkageError e) { + // hadoop classes are not in the classpath + LOG.debug("Cannot determine user/group information using Hadoop utils. " + + "Hadoop classes not loaded or compatible", e); + } catch (Throwable t) { - if (LOG.isDebugEnabled() && !(t instanceof ClassNotFoundException)) { - LOG.debug("Cannot determine user/group information using Hadoop utils.", t); - } + // some other error occurred that we should log and make known + LOG.warn("Error while accessing user/group information via Hadoop utils.", t); } String user = System.getProperty("user.name");
