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

This commit is contained in:
Gera Shegalov 2015-06-04 11:38:28 -07:00
parent 1970ca7cbc
commit 9f6d67844d
3 changed files with 13 additions and 4 deletions

View File

@ -823,6 +823,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

View File

@ -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)"));

View File

@ -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"));