Ignore any scripts that timesout for most events, except startup.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 16 Feb 2010 00:18:43 +0000 (11:18 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 16 Feb 2010 00:21:27 +0000 (11:21 +1100)
Threat hung scripts always (except startup) as success.

server/eventscript.c

index e12491c3e8f16e2a6ae12b4a42160fad4f6dd2bf..9cd95378c1a6e8b94082bf1371ad54ac12afb0e9 100644 (file)
@@ -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));