List:Commits« Previous MessageNext Message »
From:John David Duncan Date:May 17 2011 5:16am
Subject:bzr commit into mysql-5.1-telco-7.2 branch (john.duncan:4179)
View as plain text  
#At file:///Users/jdd/bzr-repo/working/cluster-7.2-labs-memcached/ based on revid:john.duncan@stripped

 4179 John David Duncan	2011-05-16
      Minor edits to unify stockholm & flex commit thread loops.

    modified:
      storage/ndb/memcache/src/schedulers/Flex_cluster.cc
      storage/ndb/memcache/src/schedulers/Stockholm.cc
=== modified file 'storage/ndb/memcache/src/schedulers/Flex_cluster.cc'
--- a/storage/ndb/memcache/src/schedulers/Flex_cluster.cc	2011-05-17 05:07:20 +0000
+++ b/storage/ndb/memcache/src/schedulers/Flex_cluster.cc	2011-05-17 05:15:50 +0000
@@ -218,23 +218,25 @@ void Scheduler_flex::Cluster::contribute
   Commit thread: Get an NdbInstance off the workqueue, and call pollNdb() on it.
 */
 void * Scheduler_flex::Cluster::run_commit_thread() {
-  DEBUG_ENTER();
-  
   workitem *item;
+  int polled;
+
+  DEBUG_ENTER();
   
   while(1) {
     /* Wait for something to appear on the queue */
     item = (workitem *) workqueue_consumer_wait(queue);
     
-    if(item == NULL) return 0;  /* queue has been shut down and emptied */
+    if(item == NULL) break;  /* queue has been shut down and emptied */
     
-    /* Send & Poll */
-    item->ndb_instance->db->sendPollNdb(WAITFOR_RESPONSE_TIMEOUT, 1, 1);
-    while(item->base.reschedule) {
+    /* Send & poll for response; reschedule if needed */
+    do {
       item->base.reschedule = 0;
-      item->ndb_instance->db->sendPollNdb(WAITFOR_RESPONSE_TIMEOUT, 1, 1);
-    }
+      polled = item->ndb_instance->db->sendPollNdb(10, 1, 1);
+    } while(item->base.reschedule || ! polled);
   } 
+
+  return NULL;
 }
 
 

=== modified file 'storage/ndb/memcache/src/schedulers/Stockholm.cc'
--- a/storage/ndb/memcache/src/schedulers/Stockholm.cc	2011-05-17 05:07:20 +0000
+++ b/storage/ndb/memcache/src/schedulers/Stockholm.cc	2011-05-17 05:15:50 +0000
@@ -260,6 +260,8 @@ void * Scheduler_stockholm::run_ndb_comm
   while(1) {
     /* Wait for something to appear on the queue */
     item = (workitem *) workqueue_consumer_wait(cluster[c].queue);
+
+    if(item == NULL) break;  /* queue has been shut down and emptied */
     
     /* Send & poll for response; reschedule if needed */
     do {
@@ -272,6 +274,8 @@ void * Scheduler_stockholm::run_ndb_comm
     if(! (cluster[c].stats.cycles % STAT_INTERVAL)) 
       cluster[c].stats.commit_thread_vtime = get_thread_vtime();
   } 
+
+  return NULL;
 }
 
 


Attachment: [text/bzr-bundle] bzr/john.duncan@oracle.com-20110517051550-wogdvu21wzmzjgt9.bundle
Thread
bzr commit into mysql-5.1-telco-7.2 branch (john.duncan:4179) John David Duncan17 May