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)
Show replies by date