[ https://issues.apache.org/jira/browse/HADOOP-11924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14571923#comment-14571923 ]
Gera Shegalov commented on HADOOP-11924: ---------------------------------------- Thanks for 002 [~ozawa]! A couple of points I missed previously: The patch uses {{t.getLocalizedMessage}}. Would not this mean that in an unlikely case that JDK implemented localization for java.lang.Error "contains" for the English description won't work. Can we switch to {{getMessage()}}. We also log the exception itself. Instead of doing instanceof check we can rely on catch. In summary: {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 {code} > Tolerate JDK-8047340-related exceptions in Shell#isSetSidAvailable preventing > class init > ---------------------------------------------------------------------------------------- > > Key: HADOOP-11924 > URL: https://issues.apache.org/jira/browse/HADOOP-11924 > Project: Hadoop Common > Issue Type: Bug > Affects Versions: 2.8.0 > Reporter: Gera Shegalov > Assignee: Tsuyoshi Ozawa > Attachments: HADOOP-11924.001.patch, HADOOP-11924.002.patch > > > Address the root cause of HADOOP-11916 per > https://issues.apache.org/jira/browse/HADOOP-11916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14528009#comment-14528009 > {quote} > JDK-8047340 explicitly calls out BSD-like systems, should not we just exclude > those systems instead of enabling solely Linux? > {code} > Assume.assumeFalse("Avoiding JDK-8047340 on BSD-based systems", Shell.FREEBSD > || Shell.MAC); > {code} > However, I don't think this is the right fix. Shell on BSD-like systems is > broken with the TR locale. Shell class initialization happens only because > StringUtils references Shell.WINDOWS. > We can simply catch Throwable in Shell#isSetsidSupported instead of > IOException. If we want to be pedantic we can rethrow > {code} > if (!(t instanceof IOException) && !(Shell.FREEBSD || Shell.MAC)) > {code} > With such a change the test can run unchanged. > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)