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