All of lore.kernel.org
 help / color / mirror / Atom feed
From: kupcevic@sourceware.org <kupcevic@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/ricci modules/cluster/ClusterStatus.cpp  ...
Date: 20 Jul 2006 08:29:50 -0000	[thread overview]
Message-ID: <20060720082950.14967.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2006-07-20 08:29:49

Modified files:
	ricci/modules/cluster: ClusterStatus.cpp 
	ricci/ricci    : Ricci.cpp RicciWorker.cpp 

Log message:
	ricci: code cleanup

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/ClusterStatus.cpp.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/Ricci.cpp.diff?cvsroot=cluster&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/ricci/RicciWorker.cpp.diff?cvsroot=cluster&r1=1.8&r2=1.9

--- conga/ricci/modules/cluster/ClusterStatus.cpp	2006/06/20 19:37:23	1.7
+++ conga/ricci/modules/cluster/ClusterStatus.cpp	2006/07/20 08:29:49	1.8
@@ -36,13 +36,15 @@
 
 
 #define INITD_DIR_PATH        "/etc/init.d/"
-#define CMAN_LEAVE_TIMEOUT    "120"
-
 #define CMAN_TOOL_PATH        "/sbin/cman_tool"
 #define LSMOD_PATH            "/sbin/lsmod"
 #define MODPROBE_PATH         "/sbin/modprobe"
 #define CHKCONFIG_PATH        "/sbin/chkconfig"
 
+#define CMAN_LEAVE_TIMEOUT    "120"  // seconds (string)
+#define CLUMON_SYNC_TIME      8      // seconds
+#define CMAN_SETTLE_TIME      3      // seconds
+
 
 
 static void run_initd(const string& servname,
@@ -67,9 +69,8 @@
     // start clumon
     run_initd("ricci-modclusterd", true, true);
     
-    // wait for it to come up and sync, 8 secs
-    for (int i=0; i<8*4; i++)
-      sleep_mil(250);
+    // wait for it to come up and sync
+    sleep_sec(CLUMON_SYNC_TIME);
     
     // try again
     ClientSocket s("/var/run/clumond.sock");
@@ -132,7 +133,7 @@
 	  if (iter->get_attr("clustered") == "false")
 	    all_in = false;
       if (all_in == false)
-	sleep_sec(8);
+	sleep_sec(CLUMON_SYNC_TIME);
     }
   }
   
@@ -244,8 +245,7 @@
   
   if (cman_loaded) {
     // wait until things settle down
-    for (int i=0; i<12; i++)
-      sleep_mil(250);
+    sleep_sec(CMAN_SETTLE_TIME);
     
     args.clear();
     args.push_back("leave");
@@ -256,8 +256,7 @@
     utils::execute(CMAN_TOOL_PATH, args, out, err, status, false);
     
     // bz149282
-    for (int i=0; i<12; i++)
-      sleep_mil(250);
+    sleep_sec(CMAN_SETTLE_TIME);
     
     args.clear();
     args.push_back("-r");
--- conga/ricci/ricci/Ricci.cpp	2006/07/12 18:46:08	1.13
+++ conga/ricci/ricci/Ricci.cpp	2006/07/20 08:29:49	1.14
@@ -194,8 +194,10 @@
       for (list<XMLObject>::const_iterator iter = req.children().begin();
 	   iter != req.children().end();
 	   iter++)
-	if (iter->tag() == "batch")
+	if (iter->tag() == "batch") {
 	  batch_xml = &(*iter);
+	  break;
+	}
       if (batch_xml) {
 	try {
 	  long long id;
--- conga/ricci/ricci/RicciWorker.cpp	2006/04/12 15:47:09	1.8
+++ conga/ricci/ricci/RicciWorker.cpp	2006/07/20 08:29:49	1.9
@@ -191,7 +191,7 @@
 	// wait until rebooted, 
 	// ricci will start new worker (after reboot) to pickup where I left
 	while (true)
-	  sleep_mil(255);
+	  sleep_sec(255);
 	return;
       }
     } else {



                 reply	other threads:[~2006-07-20  8:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060720082950.14967.qmail@sourceware.org \
    --to=kupcevic@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.