Repository: hadoop
Updated Branches:
refs/heads/branch-2.8 42c768654 -> c23744d61
YARN-8515. container-executor can crash with SIGPIPE after nodemanager restart.
Contributed by Jim Brennan
(cherry picked from commit 17118f446c2387aa796849da8b69a845d9d307d3)
Conflicts:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/main.c
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c23744d6
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c23744d6
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c23744d6
Branch: refs/heads/branch-2.8
Commit: c23744d61f7400e1648556844e6dae4ade761293
Parents: 42c7686
Author: Jason Lowe <[email protected]>
Authored: Fri Jul 13 10:05:25 2018 -0500
Committer: Jason Lowe <[email protected]>
Committed: Fri Jul 13 10:20:46 2018 -0500
----------------------------------------------------------------------
.../src/main/native/container-executor/impl/main.c | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/c23744d6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/main.c
----------------------------------------------------------------------
diff --git
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/main.c
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/main.c
index 62ae3d8..2bdcdef 100644
---
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/main.c
+++
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/main.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <signal.h>
#include <sys/stat.h>
#define CONF_FILENAME "container-executor.cfg"
@@ -120,6 +121,11 @@ static void open_log_files() {
if (ERRORFILE == NULL) {
ERRORFILE = stderr;
}
+
+ // There may be a process reading from stdout/stderr, and if it
+ // exits, we will crash on a SIGPIPE when we try to write to them.
+ // By ignoring SIGPIPE, we can handle the EPIPE instead of crashing.
+ signal(SIGPIPE, SIG_IGN);
}
/* Flushes and closes log files */
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]