HADOOP-11924. Tolerate JDK-8047340-related exceptions in Shell#isSetSidAvailable preventing class init. (Tsuyoshi Ozawa via gera)

(cherry picked from commit 9f6d67844d)
This commit is contained in:
Gera Shegalov 2015-06-04 11:38:28 -07:00
parent 6044b5e5f6
commit 2cc2488164
3 changed files with 13 additions and 4 deletions

View File

@ -339,6 +339,9 @@ Release 2.8.0 - UNRELEASED
HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible.
(Kengo Seki via Arpit Agarwal) (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 Release 2.7.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -392,7 +392,16 @@ abstract public class Shell {
} catch (IOException ioe) { } catch (IOException ioe) {
LOG.debug("setsid is not available on this machine. So not using it."); LOG.debug("setsid is not available on this machine. So not using it.");
setsidSupported = false; 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()) { if (LOG.isDebugEnabled()) {
LOG.debug("setsid exited with exit code " LOG.debug("setsid exited with exit code "
+ (shexec != null ? shexec.getExitCode() : "(null executor)")); + (shexec != null ? shexec.getExitCode() : "(null executor)"));

View File

@ -417,9 +417,6 @@ public class TestStringUtils extends UnitTestcaseTimeLimit {
@Test @Test
public void testLowerAndUpperStrings() { 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(); Locale defaultLocale = Locale.getDefault();
try { try {
Locale.setDefault(new Locale("tr", "TR")); Locale.setDefault(new Locale("tr", "TR"));