r5003 - trunk/cumin/bin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-09-23 14:20:51 +0000 (Fri, 23 Sep 2011)
New Revision: 5003
Modified:
trunk/cumin/bin/cumin-data
trunk/cumin/bin/cumin-web
Log:
Add logging shutdown call
Modified: trunk/cumin/bin/cumin-data
===================================================================
--- trunk/cumin/bin/cumin-data 2011-09-23 14:10:07 UTC (rev 5002)
+++ trunk/cumin/bin/cumin-data 2011-09-23 14:20:51 UTC (rev 5003)
@@ -226,6 +226,7 @@
mint.stop()
if pipeThread:
pipeThread.stop()
+ logging.shutdown()
sys.exit(return_code)
if __name__ == "__main__":
Modified: trunk/cumin/bin/cumin-web
===================================================================
--- trunk/cumin/bin/cumin-web 2011-09-23 14:10:07 UTC (rev 5002)
+++ trunk/cumin/bin/cumin-web 2011-09-23 14:20:51 UTC (rev 5003)
@@ -154,6 +154,7 @@
cumin.stop()
if pipeThread:
pipeThread.stop()
+ logging.shutdown()
sys.exit(return_code)
if __name__ == "__main__":
12 years, 8 months
r5002 - in trunk: cumin/python/cumin parsley/python/parsley sage/python/sage/wallaby
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-09-23 14:10:07 +0000 (Fri, 23 Sep 2011)
New Revision: 5002
Modified:
trunk/cumin/python/cumin/main.py
trunk/parsley/python/parsley/loggingex.py
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Tweaks to shutdown. Missing call to stop wallaby, logging could swallow Ctrl-C, handler around delBroker
Modified: trunk/cumin/python/cumin/main.py
===================================================================
--- trunk/cumin/python/cumin/main.py 2011-09-23 13:12:57 UTC (rev 5001)
+++ trunk/cumin/python/cumin/main.py 2011-09-23 14:10:07 UTC (rev 5002)
@@ -248,8 +248,12 @@
def stop(self):
log.info("Stopping %s", self)
+ self.wallaby.stop()
self.server.stop()
- self.session.stop()
+ try:
+ self.session.stop()
+ except:
+ pass
def set_form_defaults(self,
request_memory,
Modified: trunk/parsley/python/parsley/loggingex.py
===================================================================
--- trunk/parsley/python/parsley/loggingex.py 2011-09-23 13:12:57 UTC (rev 5001)
+++ trunk/parsley/python/parsley/loggingex.py 2011-09-23 14:10:07 UTC (rev 5002)
@@ -66,8 +66,11 @@
# Never want to crash writing out a log entry
try:
self._emit(record)
- except:
- sys.stderr.write("Warning, logging exception writing " + self.baseFilename + "\n")
+ except (KeyboardInterrupt, SystemExit):
+ # We don't want to swallow these exceptions
+ raise
+ except Exception, e:
+ sys.stderr.write("Warning, logging exception writing " + self.baseFilename + ", %s\n" % e)
def _emit(self, record):
# Following snippett taken from WatchedFileHandler in Python 2.6
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-23 13:12:57 UTC (rev 5001)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-23 14:10:07 UTC (rev 5002)
@@ -154,6 +154,9 @@
while not self._stop:
start_processing = time.time()
for attr, val in self._cache.iteritems():
+ if self._stop:
+ break
+
# val.remaining is the number of seconds left before
# the next update of this data item. None is "forever".
# Synthetic items are not retreived from the store.
@@ -170,6 +173,9 @@
# Now handle the synthetics. val.synthetic generates
# and stores it's own results.
for attr, val in self._cache.iteritems():
+ if self._stop:
+ break
+
if val.synthetic and \
val.remaining is not None and val.remaining <= 0:
get_values(attr, val.synthetic, *val.args)
12 years, 8 months
r5001 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-09-23 13:12:57 +0000 (Fri, 23 Sep 2011)
New Revision: 5001
Modified:
trunk/cumin/python/cumin/grid/tags.py
Log:
Boosting the performance of the UI by moving even trivial wallaby operations into async calls.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-09-23 12:44:39 UTC (rev 5000)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-09-23 13:12:57 UTC (rev 5001)
@@ -1048,23 +1048,36 @@
self.form.node_name.set(session, nodes)
def callback(self, result):
- self.call_count -= 1
- if result == False:
- self.invoc.status = self.invoc.FAILED
- if(self.call_count <= 0):
- self.invoc.end()
- self.app.wallaby.refresh(WBTypes.GROUPS,WBTypes.TAGS)
+ if result is not None:
+ self.call_count -= 1
+ if result == False:
+ self.invoc.status = self.invoc.FAILED
+ if(self.call_count <= 0):
+ self.invoc.end()
+ self.app.wallaby.refresh(WBTypes.GROUPS,WBTypes.TAGS)
def do_invoke(self, invoc, negotiator, tag, chosen_nodes):
'''
+ Here we just kick off an async call that does the actual work for us
+ '''
+ self.invoc = invoc
+ try:
+ call_async(self.callback, self.make_calls, invoc, tag, chosen_nodes)
+ except Exception, e:
+ self.call_count = 0
+ invoc.status = invoc.FAILED
+ log.exception(e)
+ invoc.end()
+
+ def make_calls(self, invoc, tag, chosen_nodes):
+ '''
if the node is on the current_nodes list and is on the chosen_nodes passed in, nothing to do
** if the node is NOT on the current_nodes list and is on the chosen_nodes passed in, add this tag to that node
** if the node is on the current_nodes list and is NOT on the chosen_nodes passed in, update that node sans this tag
if the node is NOT on the current_nodes list and is NOT on the chosen_nodes passed in, nothing to do
'''
- self.invoc = invoc
- current_nodes = self.app.wallaby.get_node_names(tag)
try:
+ current_nodes = self.app.wallaby.get_node_names(tag)
for node in chosen_nodes:
if node not in current_nodes:
#we need to add the new tag to the existing tags for each node in the list
@@ -1083,7 +1096,10 @@
invoc.status = invoc.FAILED
log.exception(e)
invoc.end()
+ return False
+ return None
+
class TagsFeatureEditTask(ObjectFrameTask):
'''
This is the task that will take a tag and a set of nodes and make the
12 years, 8 months
r5000 - branches/scale_testing/cumin/bin
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-09-23 12:44:39 +0000 (Fri, 23 Sep 2011)
New Revision: 5000
Modified:
branches/scale_testing/cumin/bin/cumin-web
Log:
Add a call to logging shutdown
Modified: branches/scale_testing/cumin/bin/cumin-web
===================================================================
--- branches/scale_testing/cumin/bin/cumin-web 2011-09-23 12:31:12 UTC (rev 4999)
+++ branches/scale_testing/cumin/bin/cumin-web 2011-09-23 12:44:39 UTC (rev 5000)
@@ -1,6 +1,7 @@
#!/usr/bin/python
import os
import sys
+import logging
home = os.environ.get("CUMIN_HOME", os.path.normpath("/usr/share/cumin"))
sys.path.append(os.path.join(home, "python"))
@@ -10,6 +11,7 @@
from cumin.util import *
from parsley.loggingex import PipeLogThread
+
def restore_IO():
sys.stderr = sys.__stderr__
sys.stdout = sys.__stdout__
@@ -154,6 +156,8 @@
cumin.stop()
if pipeThread:
pipeThread.stop()
+ print "calling logging shutdown"
+ logging.shutdown()
sys.exit(return_code)
if __name__ == "__main__":
12 years, 8 months
r4999 - trunk/sage/python/sage/wallaby
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-09-23 12:31:12 +0000 (Fri, 23 Sep 2011)
New Revision: 4999
Modified:
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Add execption handler around delBroker in wallabyoperations
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 19:39:17 UTC (rev 4998)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-23 12:31:12 UTC (rev 4999)
@@ -211,7 +211,10 @@
self._store = None
# Have to clean up the broker
- self.session.delBroker(self.broker)
+ try:
+ self.session.delBroker(self.broker)
+ except:
+ pass
#end maintain_cache
12 years, 8 months
r4998 - trunk/sage/python/sage/wallaby
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-09-22 19:39:17 +0000 (Thu, 22 Sep 2011)
New Revision: 4998
Modified:
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Add call to clean up session in wallabyoperations on exit
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 18:45:48 UTC (rev 4997)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 19:39:17 UTC (rev 4998)
@@ -209,6 +209,10 @@
for attr in self._cache:
self._set_cache(attr, [])
self._store = None
+
+ # Have to clean up the broker
+ self.session.delBroker(self.broker)
+
#end maintain_cache
def get_values(attr, call, *args):
12 years, 8 months
r4997 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-09-22 18:45:48 +0000 (Thu, 22 Sep 2011)
New Revision: 4997
Modified:
trunk/cumin/python/cumin/grid/tags.py
Log:
Adding a refresh of wallaby data after an edit_tags call.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-09-22 18:15:26 UTC (rev 4996)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-09-22 18:45:48 UTC (rev 4997)
@@ -1052,7 +1052,8 @@
if result == False:
self.invoc.status = self.invoc.FAILED
if(self.call_count <= 0):
- self.invoc.end()
+ self.invoc.end()
+ self.app.wallaby.refresh(WBTypes.GROUPS,WBTypes.TAGS)
def do_invoke(self, invoc, negotiator, tag, chosen_nodes):
'''
12 years, 8 months
r4996 - trunk/sage/python/sage/wallaby
by croberts@fedoraproject.org
Author: croberts
Date: 2011-09-22 18:15:26 +0000 (Thu, 22 Sep 2011)
New Revision: 4996
Modified:
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Now using _lock to protect the wallaby call in edit_tags. This seems to be sufficient to let all of the edit_tags requests to succeed.
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 17:34:29 UTC (rev 4995)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 18:15:26 UTC (rev 4996)
@@ -473,16 +473,20 @@
log.debug("WallabyOperations: edit_tags, node not found %s" % str(n))
else:
try:
- # cast to list in case tags is a tuple, list required
- start = time.time()
- n.modifyTags("REPLACE", list(tags), create_missing_tags=True)
- n.update()
- status = True
-
- delta = time.time() - start
- log.debug("WallabyOperations: edit_tags %s" % delta)
- except Exception, e:
- log.debug("WallabyOperations: edit_tags, exception suppressed, %s" % str(e))
+ try:
+ # cast to list in case tags is a tuple, list required
+ start = time.time()
+ self._lock.acquire()
+ n.modifyTags("REPLACE", list(tags), create_missing_tags=True)
+ n.update()
+ status = True
+
+ delta = time.time() - start
+ log.debug("WallabyOperations: edit_tags %s" % delta)
+ except Exception, e:
+ log.debug("WallabyOperations: edit_tags, exception suppressed, %s" % str(e))
+ finally:
+ self._lock.release()
return status
def edit_features(self, group, *features):
12 years, 8 months
r4995 - in trunk: cumin/python/cumin/grid sage/python/sage/wallaby
by croberts@fedoraproject.org
Author: croberts
Date: 2011-09-22 17:34:29 +0000 (Thu, 22 Sep 2011)
New Revision: 4995
Modified:
trunk/cumin/python/cumin/grid/tags.py
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
moving the refresh call from the edit_tags method and leaving it to the caller.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-09-22 15:30:03 UTC (rev 4994)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-09-22 17:34:29 UTC (rev 4995)
@@ -1011,6 +1011,7 @@
if result == False:
self.invoc.status = self.invoc.FAILED
self.invoc.end()
+ self.app.wallaby.refresh(WBTypes.GROUPS,WBTypes.TAGS)
def do_invoke(self, invoc, negotiator, node_name, tags):
self.invoc = invoc
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 15:30:03 UTC (rev 4994)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 17:34:29 UTC (rev 4995)
@@ -479,9 +479,6 @@
n.update()
status = True
- # refresh the groups and tags so that membership information
- # is up to date.
- self.refresh(WBTypes.GROUPS,WBTypes.TAGS)
delta = time.time() - start
log.debug("WallabyOperations: edit_tags %s" % delta)
except Exception, e:
12 years, 8 months
r4994 - trunk/sage/python/sage/wallaby
by croberts@fedoraproject.org
Author: croberts
Date: 2011-09-22 15:30:03 +0000 (Thu, 22 Sep 2011)
New Revision: 4994
Modified:
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
reworking the try/except/finally block in create_tags so that it will also work under python 2.4
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 15:11:06 UTC (rev 4993)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-09-22 15:30:03 UTC (rev 4994)
@@ -416,14 +416,14 @@
if self._store is None:
log.debug("WallabyOperations: create_tag, store object not yet created")
return False
-
try:
self._lock.acquire()
- for name in names:
- self._store.addTag(name)
- except Exception, e:
- log.debug("WallabyOperations: create_tag, exception suppressed, %s" % str(e))
- return False
+ try:
+ for name in names:
+ self._store.addTag(name)
+ except Exception, e:
+ log.debug("WallabyOperations: create_tag, exception suppressed, %s" % str(e))
+ return False
finally:
self._lock.release()
return True
12 years, 8 months