summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2010-02-16 11:18:43 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2010-02-16 11:21:27 +1100
commit68decc38cae6e57e379c91657aad77a39d0e5b0b (patch)
tree84a992061297b4b44ec6ce1825e54dd44818ae82
parent5439401dd26d67e379a62abf317b12be8317293b (diff)
downloadsamba-68decc38cae6e57e379c91657aad77a39d0e5b0b.tar.gz
Ignore any scripts that timesout for most events, except startup.
Threat hung scripts always (except startup) as success. (This used to be ctdb commit b6d939c9758c7d2e39206838492f2f644dd61db7)
-rw-r--r--ctdb/server/eventscript.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index e12491c3e8f..9cd95378c1a 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/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));