diff options
author | demon <demon@FreeBSD.org> | 2015-01-06 06:49:41 +0800 |
---|---|---|
committer | demon <demon@FreeBSD.org> | 2015-01-06 06:49:41 +0800 |
commit | 603a171c6f5d7076d391f81f0a56bffa6de1ff28 (patch) | |
tree | 7781d95ba2abf3c9ad5f2cb512622aadc820b453 /devel/hadoop2 | |
parent | 4b6a5ab317fd37a304c17e78a6455b7ae34d65ca (diff) | |
download | freebsd-ports-gnome-603a171c6f5d7076d391f81f0a56bffa6de1ff28.tar.gz freebsd-ports-gnome-603a171c6f5d7076d391f81f0a56bffa6de1ff28.tar.zst freebsd-ports-gnome-603a171c6f5d7076d391f81f0a56bffa6de1ff28.zip |
Use ssid instead of Linux setsid(1): without it if task process spawns a
subprocess (common case if task process is a shell script) and job is being
killed with mapred job -kill <...>, then subprocess will not die and remain
running orphaned.
Diffstat (limited to 'devel/hadoop2')
5 files changed, 66 insertions, 2 deletions
diff --git a/devel/hadoop2/Makefile b/devel/hadoop2/Makefile index e46445fb81b9..8e80342b76ef 100644 --- a/devel/hadoop2/Makefile +++ b/devel/hadoop2/Makefile @@ -7,7 +7,7 @@ # no problems encountered so far. Thanks. PORTNAME= hadoop PORTVERSION= 2.4.1 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= devel java MASTER_SITES= ${MASTER_SITE_APACHE} \ LOCAL/demon/ \ @@ -28,7 +28,8 @@ BUILD_DEPENDS= ${LOCALBASE}/share/java/maven3/bin/mvn:${PORTSDIR}/devel/maven3 \ cmake:${PORTSDIR}/devel/cmake \ ${LOCALBASE}/protobuf25/bin/protoc:${PORTSDIR}/devel/protobuf25 LIB_DEPENDS= libsnappy.so:${PORTSDIR}/archivers/snappy -RUN_DEPENDS= bash:${PORTSDIR}/shells/bash +RUN_DEPENDS= bash:${PORTSDIR}/shells/bash \ + ssid:${PORTSDIR}/sysutils/ssid CONFLICTS_INSTALL= apache-hadoop-1* diff --git a/devel/hadoop2/files/patch-hadoop-common-project-hadoop-common-src-main-java-org-apache-hadoop-util-Shell.java b/devel/hadoop2/files/patch-hadoop-common-project-hadoop-common-src-main-java-org-apache-hadoop-util-Shell.java new file mode 100644 index 000000000000..89a0fa4ded2f --- /dev/null +++ b/devel/hadoop2/files/patch-hadoop-common-project-hadoop-common-src-main-java-org-apache-hadoop-util-Shell.java @@ -0,0 +1,21 @@ +--- ./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java.orig 2014-06-21 09:40:07.000000000 +0400 ++++ ./hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/Shell.java 2015-01-06 01:21:22.000000000 +0300 +@@ -348,15 +348,15 @@ abstract public class Shell { + ShellCommandExecutor shexec = null; + boolean setsidSupported = true; + try { +- String[] args = {"setsid", "bash", "-c", "echo $$"}; ++ String[] args = {"ssid", "bash", "-c", "echo $$"}; + shexec = new ShellCommandExecutor(args); + shexec.execute(); + } catch (IOException ioe) { +- LOG.debug("setsid is not available on this machine. So not using it."); ++ LOG.debug("ssid is not available on this machine. So not using it."); + setsidSupported = false; + } finally { // handle the exit code + if (LOG.isDebugEnabled()) { +- LOG.debug("setsid exited with exit code " ++ LOG.debug("ssid exited with exit code " + + (shexec != null ? shexec.getExitCode() : "(null executor)")); + } + } diff --git a/devel/hadoop2/files/patch-hadoop-mapreduce-client-core-src-main-java-org-apache-hadoop-mapred-TaskLog.java b/devel/hadoop2/files/patch-hadoop-mapreduce-client-core-src-main-java-org-apache-hadoop-mapred-TaskLog.java new file mode 100644 index 000000000000..86928a25ba47 --- /dev/null +++ b/devel/hadoop2/files/patch-hadoop-mapreduce-client-core-src-main-java-org-apache-hadoop-mapred-TaskLog.java @@ -0,0 +1,11 @@ +--- ./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java.orig 2015-01-06 01:14:31.000000000 +0300 ++++ ./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/TaskLog.java 2015-01-06 01:14:47.000000000 +0300 +@@ -538,7 +538,7 @@ public class TaskLog { + mergedCmd.append("("); + } else if(ProcessTree.isSetsidAvailable && useSetsid && + !Shell.WINDOWS) { +- mergedCmd.append("exec setsid "); ++ mergedCmd.append("exec ssid "); + } else { + mergedCmd.append("exec "); + } diff --git a/devel/hadoop2/files/patch-hadoop-mapreduce-client-core-src-main-java-org-apache-hadoop-mapreduce-util-ProcessTree.java b/devel/hadoop2/files/patch-hadoop-mapreduce-client-core-src-main-java-org-apache-hadoop-mapreduce-util-ProcessTree.java new file mode 100644 index 000000000000..5cea6111db95 --- /dev/null +++ b/devel/hadoop2/files/patch-hadoop-mapreduce-client-core-src-main-java-org-apache-hadoop-mapreduce-util-ProcessTree.java @@ -0,0 +1,20 @@ +--- ./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ProcessTree.java.orig 2015-01-06 01:16:49.000000000 +0300 ++++ ./hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/util/ProcessTree.java 2015-01-06 01:17:24.000000000 +0300 +@@ -54,14 +54,14 @@ public class ProcessTree { + ShellCommandExecutor shexec = null; + boolean setsidSupported = true; + try { +- String[] args = {"setsid", "bash", "-c", "echo $$"}; ++ String[] args = {"ssid", "bash", "-c", "echo $$"}; + shexec = new ShellCommandExecutor(args); + shexec.execute(); + } catch (IOException ioe) { +- LOG.warn("setsid is not available on this machine. So not using it."); ++ LOG.warn("ssid is not available on this machine. So not using it."); + setsidSupported = false; + } finally { // handle the exit code +- LOG.info("setsid exited with exit code " + shexec.getExitCode()); ++ LOG.info("ssid exited with exit code " + shexec.getExitCode()); + } + return setsidSupported; + } diff --git a/devel/hadoop2/files/patch-src-main-java-org-apache-hadoop-yarn-server-nodemanager-DefaultContainerExecutor.java b/devel/hadoop2/files/patch-src-main-java-org-apache-hadoop-yarn-server-nodemanager-DefaultContainerExecutor.java new file mode 100644 index 000000000000..8731545b8b8f --- /dev/null +++ b/devel/hadoop2/files/patch-src-main-java-org-apache-hadoop-yarn-server-nodemanager-DefaultContainerExecutor.java @@ -0,0 +1,11 @@ +--- ./hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java.orig 2015-01-06 01:28:53.000000000 +0300 ++++ ./hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java 2015-01-06 01:29:32.000000000 +0300 +@@ -277,7 +277,7 @@ public class DefaultContainerExecutor ex + pout.println(); + pout.println("echo $$ > " + pidFile.toString() + ".tmp"); + pout.println("/bin/mv -f " + pidFile.toString() + ".tmp " + pidFile); +- String exec = Shell.isSetsidAvailable? "exec setsid" : "exec"; ++ String exec = Shell.isSetsidAvailable? "exec ssid" : "exec"; + pout.println(exec + " /bin/bash \"" + + launchDst.toUri().getPath().toString() + "\""); + } |