1
1

Report, but ignore, SIGPIPE events. The odls already resets this signal handler when spawning local procs.

This commit was SVN r22463.
Этот коммит содержится в:
Ralph Castain 2010-01-21 05:01:06 +00:00
родитель 31cdbcfa5f
Коммит 2517799102
2 изменённых файлов: 37 добавлений и 0 удалений

Просмотреть файл

@ -97,6 +97,7 @@
static opal_event_t term_handler;
static opal_event_t int_handler;
static opal_event_t pipe_handler;
static opal_event_t epipe_handler;
#ifndef __WINDOWS__
static opal_event_t sigusr1_handler;
static opal_event_t sigusr2_handler;
@ -108,6 +109,7 @@ static bool signals_set=false;
static void shutdown_callback(int fd, short flags, void *arg);
static void shutdown_signal(int fd, short flags, void *arg);
static void signal_callback(int fd, short event, void *arg);
static void epipe_signal_callback(int fd, short flags, void *arg);
static struct {
bool debug;
@ -440,6 +442,10 @@ int orte_daemon(int argc, char *argv[])
}
#ifndef __WINDOWS__
/* setup callback for SIGPIPE */
opal_signal_set(&epipe_handler, SIGPIPE,
epipe_signal_callback, &epipe_handler);
opal_signal_add(&epipe_handler, NULL);
/* Set signal handlers to catch kill signals so we can properly clean up
* after ourselves.
*/
@ -896,6 +902,7 @@ static void shutdown_callback(int fd, short flags, void *arg)
if (signals_set) {
/* Release all local signal handlers */
opal_event_del(&epipe_handler);
opal_event_del(&term_handler);
opal_event_del(&int_handler);
#ifndef __WINDOWS__
@ -909,6 +916,17 @@ static void shutdown_callback(int fd, short flags, void *arg)
exit(orte_exit_status);
}
/**
* Deal with sigpipe errors
*/
static void epipe_signal_callback(int fd, short flags, void *arg)
{
/* for now, we just announce and ignore them */
opal_output(0, "%s reports a SIGPIPE error on fd %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fd);
return;
}
static void signal_callback(int fd, short event, void *arg)
{
/* just ignore these signals */

Просмотреть файл

@ -100,6 +100,7 @@
*/
static struct opal_event term_handler;
static struct opal_event int_handler;
static struct opal_event epipe_handler;
#ifndef __WINDOWS__
static struct opal_event sigusr1_handler;
static struct opal_event sigusr2_handler;
@ -431,6 +432,7 @@ static opal_cmd_line_init_t cmd_line_init[] = {
static void job_completed(int trigpipe, short event, void *arg);
static void abort_signal_callback(int fd, short flags, void *arg);
static void abort_exit_callback(int fd, short event, void *arg);
static void epipe_signal_callback(int fd, short flags, void *arg);
static void signal_forward_callback(int fd, short event, void *arg);
static int create_app(int argc, char* argv[], orte_app_context_t **app,
bool *made_app, char ***app_env);
@ -635,6 +637,10 @@ int orterun(int argc, char *argv[])
}
#ifndef __WINDOWS__
/* setup callback for SIGPIPE */
opal_signal_set(&epipe_handler, SIGPIPE,
epipe_signal_callback, &epipe_handler);
opal_signal_add(&epipe_handler, NULL);
/** setup callbacks for abort signals - from this point
* forward, we need to abort in a manner that allows us
* to cleanup
@ -895,6 +901,8 @@ static void just_quit(int fd, short ign, void *arg)
}
if (signals_set) {
/* Remove the epipe handler */
opal_signal_del(&epipe_handler);
/* Remove the TERM and INT signal handlers */
opal_signal_del(&term_handler);
opal_signal_del(&int_handler);
@ -1176,6 +1184,17 @@ static void abort_signal_callback(int fd, short flags, void *arg)
ORTE_TIMER_EVENT(0, 0, abort_exit_callback);
}
/**
* Deal with sigpipe errors
*/
static void epipe_signal_callback(int fd, short flags, void *arg)
{
/* for now, we just announce and ignore them */
opal_output(0, "%s reports a SIGPIPE error on fd %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fd);
return;
}
/**
* Pass user signals to the remote application processes
*/