diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 068a3b29e0f..ca80a5f7d2f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -339,6 +339,9 @@ Release 2.8.0 - UNRELEASED HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Kengo Seki via Arpit Agarwal) + HADOOP-11924. Tolerate JDK-8047340-related exceptions in + Shell#isSetSidAvailable preventing class init. (Tsuyoshi Ozawa via gera) + Release 2.7.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java index f0100d440ab..c76c92181c8 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java @@ -392,7 +392,16 @@ abstract public class Shell { } catch (IOException ioe) { LOG.debug("setsid is not available on this machine. So not using it."); setsidSupported = false; - } finally { // handle the exit code + } catch (Error err) { + if (err.getMessage().contains("posix_spawn is not " + + "a supported process launch mechanism") + && (Shell.FREEBSD || Shell.MAC)) { + // HADOOP-11924: This is a workaround to avoid failure of class init + // by JDK issue on TR locale(JDK-8047340). + LOG.info("Avoiding JDK-8047340 on BSD-based systems.", err); + setsidSupported = false; + } + } finally { // handle the exit code if (LOG.isDebugEnabled()) { LOG.debug("setsid exited with exit code " + (shexec != null ? shexec.getExitCode() : "(null executor)")); diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestStringUtils.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestStringUtils.java index 5b0715fdde9..85ab8c4ef27 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestStringUtils.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestStringUtils.java @@ -417,9 +417,6 @@ public class TestStringUtils extends UnitTestcaseTimeLimit { @Test public void testLowerAndUpperStrings() { - // Due to java bug http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8047340, - // The test will fail with Turkish locality on Mac OS. - Assume.assumeTrue(Shell.LINUX); Locale defaultLocale = Locale.getDefault(); try { Locale.setDefault(new Locale("tr", "TR"));