From: Ronnie Sahlberg Date: Tue, 16 Feb 2010 00:18:43 +0000 (+1100) Subject: Ignore any scripts that timesout for most events, except startup. X-Git-Tag: ctdb-1.0.114~35 X-Git-Url: http://git.samba.org/?p=sahlberg%2Fctdb.git;a=commitdiff_plain;h=b6d939c9758c7d2e39206838492f2f644dd61db7 Ignore any scripts that timesout for most events, except startup. Threat hung scripts always (except startup) as success. --- diff --git a/server/eventscript.c b/server/eventscript.c index e12491c3..9cd95378 100644 --- a/server/eventscript.c +++ b/server/eventscript.c @@ -516,7 +516,21 @@ static void ctdb_event_script_timeout(struct event_context *ev, struct timed_eve DEBUG(DEBUG_ERR,("Event script timed out : %s %s %s count : %u pid : %d\n", current->name, ctdb_eventscript_call_names[state->call], state->options, ctdb->event_script_timeouts, state->child)); - state->scripts->scripts[state->current].status = -ETIME; + /* ignore timeouts for these events */ + switch (state->call) { + case CTDB_EVENT_START_RECOVERY: + case CTDB_EVENT_RECOVERED: + case CTDB_EVENT_TAKE_IP: + case CTDB_EVENT_RELEASE_IP: + case CTDB_EVENT_STOPPED: + case CTDB_EVENT_MONITOR: + case CTDB_EVENT_STATUS: + state->scripts->scripts[state->current].status = 0; + DEBUG(DEBUG_ERR,("Ignoring hung script for %s call %d\n", state->options, state->call)); + break; + default: + state->scripts->scripts[state->current].status = -ETIME; + } if (kill(state->child, 0) != 0) { DEBUG(DEBUG_ERR,("Event script child process already dead, errno %s(%d)\n", strerror(errno), errno));