From 30c635fd4dca343b03ec40ea7c2ceb3f7d1e79d0 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Thu, 25 Nov 2010 15:25:24 +0000 Subject: [PATCH] Don't endlessly output sigpipe errors. Count the number of times we trap it, and abort if we get more than 10 of them. This commit was SVN r24091. --- orte/mca/ess/hnp/ess_hnp_module.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/orte/mca/ess/hnp/ess_hnp_module.c b/orte/mca/ess/hnp/ess_hnp_module.c index dfdf462477..887d6e4ba8 100644 --- a/orte/mca/ess/hnp/ess_hnp_module.c +++ b/orte/mca/ess/hnp/ess_hnp_module.c @@ -1054,12 +1054,23 @@ static void abort_signal_callback(int fd, short flags, void *arg) /** * Deal with sigpipe errors */ +static int sigpipe_error_count=0; static void epipe_signal_callback(int fd, short flags, void *arg) { - /* for now, we just announce and ignore them */ - OPAL_OUTPUT_VERBOSE((1, orte_debug_verbosity, - "%s reports a SIGPIPE error on fd %d", - ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fd)); + sigpipe_error_count++; + if (1 == sigpipe_error_count) { + /* announce it */ + OPAL_OUTPUT_VERBOSE((1, orte_debug_verbosity, + "%s reports a SIGPIPE error on fd %d", + ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fd)); + } + + if (10 < sigpipe_error_count) { + /* time to abort */ + opal_output(0, "%s: SIGPIPE detected - aborting", orte_basename); + abort_exit_callback(0, 0, 0); + } + return; }