Skip to contentSkip to conversation

rgmanager: Fix dependency restart bug [RHEL5]

PATCH New Lon Hohberger 2 participants 2 messages Oct 11, 2011 – Oct 12, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rgmanager: Fix dependency restart bug [RHEL5]

If we:
- had a service with 'depend' set on another service,
- both services were running on the same host,
- that host died, and
- the service which depended on the other service also had the 'restart' recovery policy,

rgmanager would enter handle_start_req and return an immediate error - with no further recovery action performed.

Resolves: rhbz#743442

---
 rgmanager/src/daemons/rg_state.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
rgmanager/src/daemons/rg_state.c +9 -1
index dce28db..c02bfda 100644
@@ -2131,8 +2131,16 @@ handle_start_req(char *svcName, int req, int *new_owner)
 
 	/* Check for dependency.  We cannot start unless our
 	   dependency is met */
-	if (check_depend_safe(svcName) == 0)
+	if (check_depend_safe(svcName) == 0) {
+		if (req == RG_START_RECOVER) {
+			clulog(LOG_INFO, "Dependency for %s missing "
+			       "during recovery; marking as stopped",
+			       svcName);
+
+			_svc_stop_finish(svcName, 0, RG_STATE_STOPPED);
+		}
 		return RG_EDEPEND;
+	}
 	
 	/*
 	 * This is a 'root' start request.  We need to clear out our failure
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 rgmanager: Fix dependency restart bug [RHEL5]

ACK

don?t we need a RHEL-6 counter part for this BZ?

Fabio

Quoted 41 lines · Lon Hohberger

If we:
- had a service with 'depend' set on another service,
- both services were running on the same host,
- that host died, and
- the service which depended on the other service also had the 'restart' recovery policy,

rgmanager would enter handle_start_req and return an immediate error - with no further recovery action performed.

Resolves: rhbz#743442

---
 rgmanager/src/daemons/rg_state.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
rgmanager/src/daemons/rg_state.c +9 -1
index dce28db..c02bfda 100644
@@ -2131,8 +2131,16 @@ handle_start_req(char *svcName, int req, int *new_owner)
 
 	/* Check for dependency.  We cannot start unless our
 	   dependency is met */
-	if (check_depend_safe(svcName) == 0)
+	if (check_depend_safe(svcName) == 0) {
+		if (req == RG_START_RECOVER) {
+			clulog(LOG_INFO, "Dependency for %s missing "
+			       "during recovery; marking as stopped",
+			       svcName);
+
+			_svc_stop_finish(svcName, 0, RG_STATE_STOPPED);
+		}
 		return RG_EDEPEND;
+	}
 
 	/*
 	 * This is a 'root' start request.  We need to clear out our failure