Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 210551 Details for
Bug 310981
resource agents probe more often than configured
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
RHEL4 patch
rgmanager-rhel4-status-timing.patch (text/plain), 6.13 KB, created by
Lon Hohberger
on 2007-09-28 14:48:31 UTC
(
hide
)
Description:
RHEL4 patch
Filename:
MIME Type:
Creator:
Lon Hohberger
Created:
2007-09-28 14:48:31 UTC
Size:
6.13 KB
patch
obsolete
>Index: include/reslist.h >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/include/reslist.h,v >retrieving revision 1.8.2.7 >diff -u -r1.8.2.7 reslist.h >--- include/reslist.h 3 May 2007 15:02:46 -0000 1.8.2.7 >+++ include/reslist.h 28 Sep 2007 13:47:38 -0000 >@@ -101,6 +101,7 @@ > time_t ra_last; > time_t ra_interval; > int ra_depth; >+ int _pad_; > } resource_act_t; > > >@@ -138,6 +139,10 @@ > resource_act_t *rn_actions; > int rn_state; /* State of this instance of rn_resource */ > int rn_flags; >+ int rn_last_status; >+ int rn_last_depth; >+ int rn_checked; >+ int rn_pad; > } resource_node_t; > > typedef struct _fod_node { >Index: src/daemons/groups.c >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/groups.c,v >retrieving revision 1.8.2.20 >diff -u -r1.8.2.20 groups.c >--- src/daemons/groups.c 31 Jul 2007 18:26:39 -0000 1.8.2.20 >+++ src/daemons/groups.c 28 Sep 2007 13:47:38 -0000 >@@ -133,6 +133,40 @@ > } > > >+static inline int >+is_exclusive_res(resource_t *res) >+{ >+ char *val; >+ >+ val = res_attr_value(res, "exclusive"); >+ if (val && ((!strcmp(val, "yes") || >+ (atoi(val)>0))) ) { >+ return 1; >+ } >+ return 0; >+} >+ >+ >+/* Locked exported function */ >+int >+is_exclusive(char *svcName) >+{ >+ int ret = 0; >+ resource_t *res = NULL; >+ >+ pthread_rwlock_rdlock(&resource_lock); >+ res = find_root_by_ref(&_resources, svcName); >+ >+ if (!res) >+ ret = RG_ENOSERVICE; >+ else >+ ret = is_exclusive_res(res); >+ >+ pthread_rwlock_unlock(&resource_lock); >+ return ret; >+} >+ >+ > int get_rg_state_local(char *, rg_state_t *); > int > count_resource_groups_local(cluster_member_t *mp) >@@ -147,6 +181,7 @@ > pthread_rwlock_rdlock(&resource_lock); > > list_do(&_resources, res) { >+ > if (res->r_rule->rr_root == 0) > continue; > >@@ -165,11 +200,8 @@ > > ++mp->cm_svccount; > >- val = res_attr_value(res, "exclusive"); >- if (val && ((!strcmp(val, "yes") || >- (atoi(val)>0))) ) { >+ if (is_exclusive_res(res)) > ++mp->cm_svcexcl; >- } > > } while (!list_done(&_resources, res)); > >@@ -180,21 +212,17 @@ > > > int >-have_exclusive_resources() >+have_exclusive_resources(void) > { > resource_t *res; >- char *val; > > pthread_rwlock_rdlock(&resource_lock); > > list_do(&_resources, res) { >- val = res_attr_value(res, "exclusive"); >- if (val && ((!strcmp(val, "yes") || >- (atoi(val)>0))) ) { >+ if (is_exclusive_res(res)) { > pthread_rwlock_unlock(&resource_lock); > return 1; > } >- > } while (!list_done(&_resources, res)); > > pthread_rwlock_unlock(&resource_lock); >Index: src/daemons/resrules.c >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/resrules.c,v >retrieving revision 1.9.2.7 >diff -u -r1.9.2.7 resrules.c >--- src/daemons/resrules.c 20 Mar 2007 19:40:06 -0000 1.9.2.7 >+++ src/daemons/resrules.c 28 Sep 2007 13:47:38 -0000 >@@ -298,6 +298,7 @@ > acts[0].ra_depth = depth; > acts[0].ra_timeout = timeout; > acts[0].ra_interval = interval; >+ acts[0].ra_last = 0; > acts[1].ra_name = NULL; > > *actsp = acts; >@@ -342,6 +343,7 @@ > acts[x].ra_depth = depth; > acts[x].ra_timeout = timeout; > acts[x].ra_interval = interval; >+ acts[x].ra_last = 0; > > acts[x+1].ra_name = NULL; > >Index: src/daemons/restree.c >=================================================================== >RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/restree.c,v >retrieving revision 1.10.2.16 >diff -u -r1.10.2.16 restree.c >--- src/daemons/restree.c 2 May 2007 22:54:28 -0000 1.10.2.16 >+++ src/daemons/restree.c 28 Sep 2007 13:47:38 -0000 >@@ -1053,35 +1062,51 @@ > > now = time(NULL); > >- for (; node->rn_actions[x].ra_name; x++) { >+ for (; node->rn_actions[x].ra_name; x++) { > if (!has_recover && >- !strcmp(node->rn_actions[x].ra_name, "recover")) { >+ !strcmp(node->rn_actions[x].ra_name, "recover")) { > has_recover = 1; > continue; > } > >- if (strcmp(node->rn_actions[x].ra_name, "status")) >+ if (strcmp(node->rn_actions[x].ra_name, "status")) > continue; > >- delta = now - node->rn_actions[x].ra_last; >+ delta = now - node->rn_actions[x].ra_last; > >- /* Ok, it's a 'monitor' action. See if enough time has >- elapsed for a given type of monitoring action */ >- if (delta < node->rn_actions[x].ra_interval) >+ /* >+ printf("%s:%s %s level %d interval = %d elapsed = %d\n", >+ node->rn_resource->r_rule->rr_type, >+ node->rn_resource->r_attrs->ra_value, >+ node->rn_actions[x].ra_name, node->rn_actions[x].ra_depth, >+ (int)node->rn_actions[x].ra_interval, (int)delta); >+ */ >+ >+ /* Ok, it's a 'status' action. See if enough time has >+ elapsed for a given type of status action */ >+ if (delta < node->rn_actions[x].ra_interval) > continue; > > if (idx == -1 || >- node->rn_actions[x].ra_depth > node->rn_actions[idx].ra_depth) >+ node->rn_actions[x].ra_depth > node->rn_actions[idx].ra_depth) > idx = x; > } > > /* No check levels ready at the moment. */ >- if (idx == -1) >+ if (idx == -1) { >+ if (node->rn_checked) >+ return node->rn_last_status; > return 0; >+ } > >- node->rn_actions[idx].ra_last = now; >- if ((x = res_exec(node, RS_STATUS, >- node->rn_actions[idx].ra_depth)) == 0) >+ node->rn_actions[idx].ra_last = now; >+ x = res_exec(node, RS_STATUS, node->rn_actions[idx].ra_depth); >+ >+ node->rn_last_status = x; >+ node->rn_last_depth = node->rn_actions[idx].ra_depth; >+ node->rn_checked = 1; >+ >+ if (x == 0) > return 0; > > if (!has_recover) >@@ -1138,18 +1163,21 @@ > { > time_t now; > int x = 0; >- resource_t *res = node->rn_resource; > >- now = res->r_started; >+ now = time(NULL); > >- for (; node->rn_actions[x].ra_name; x++) { >+ for (; node->rn_actions[x].ra_name; x++) { > >- if (strcmp(node->rn_actions[x].ra_name, "monitor") && >- strcmp(node->rn_actions[x].ra_name, "status")) >+ if (strcmp(node->rn_actions[x].ra_name, "monitor") && >+ strcmp(node->rn_actions[x].ra_name, "status")) > continue; > >- node->rn_actions[x].ra_last = now; >+ node->rn_actions[x].ra_last = now; > } >+ >+ node->rn_checked = 0; >+ node->rn_last_status = 0; >+ node->rn_last_depth = 0; > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 310981
:
210411
| 210551 |
210661