HADOOP-13770. Shell.checkIsBashSupported swallowed an interrupted exception. Contributed by Wei-Chiu Chuang
This commit is contained in:
parent
3de130252d
commit
c017171da0
@ -734,8 +734,7 @@ public static File getWinUtilsFile() throws FileNotFoundException {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final boolean isBashSupported = checkIsBashSupported();
|
public static boolean checkIsBashSupported() throws InterruptedIOException {
|
||||||
private static boolean checkIsBashSupported() {
|
|
||||||
if (Shell.WINDOWS) {
|
if (Shell.WINDOWS) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -746,6 +745,9 @@ private static boolean checkIsBashSupported() {
|
|||||||
String[] args = {"bash", "-c", "echo 1000"};
|
String[] args = {"bash", "-c", "echo 1000"};
|
||||||
shexec = new ShellCommandExecutor(args);
|
shexec = new ShellCommandExecutor(args);
|
||||||
shexec.execute();
|
shexec.execute();
|
||||||
|
} catch (InterruptedIOException iioe) {
|
||||||
|
LOG.warn("Interrupted, unable to determine if bash is supported", iioe);
|
||||||
|
throw iioe;
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
LOG.warn("Bash is not supported by the OS", ioe);
|
LOG.warn("Bash is not supported by the OS", ioe);
|
||||||
supported = false;
|
supported = false;
|
||||||
|
@ -750,7 +750,7 @@ private void initAndStartNodeManager(Configuration conf, boolean hasToReboot) {
|
|||||||
// Failed to start if we're a Unix based system but we don't have bash.
|
// Failed to start if we're a Unix based system but we don't have bash.
|
||||||
// Bash is necessary to launch containers under Unix-based systems.
|
// Bash is necessary to launch containers under Unix-based systems.
|
||||||
if (!Shell.WINDOWS) {
|
if (!Shell.WINDOWS) {
|
||||||
if (!Shell.isBashSupported) {
|
if (!Shell.checkIsBashSupported()) {
|
||||||
String message =
|
String message =
|
||||||
"Failing NodeManager start since we're on a "
|
"Failing NodeManager start since we're on a "
|
||||||
+ "Unix-based system but bash doesn't seem to be available.";
|
+ "Unix-based system but bash doesn't seem to be available.";
|
||||||
|
Loading…
Reference in New Issue
Block a user