[CalendarServer-changes] [7410] CalendarServer/trunk/contrib/performance/loadtest/sim.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue May 3 13:14:44 PDT 2011
Revision: 7410
http://trac.macosforge.org/projects/calendarserver/changeset/7410
Author: exarkun at twistedmatrix.com
Date: 2011-05-03 13:14:43 -0700 (Tue, 03 May 2011)
Log Message:
-----------
Stop observers when reactor shutdown is initiated to ignore failures due merely to the shutdown event.
Modified Paths:
--------------
CalendarServer/trunk/contrib/performance/loadtest/sim.py
Modified: CalendarServer/trunk/contrib/performance/loadtest/sim.py
===================================================================
--- CalendarServer/trunk/contrib/performance/loadtest/sim.py 2011-05-03 17:57:17 UTC (rev 7409)
+++ CalendarServer/trunk/contrib/performance/loadtest/sim.py 2011-05-03 20:14:43 UTC (rev 7410)
@@ -22,7 +22,7 @@
from twisted.python import context
from twisted.python.filepath import FilePath
-from twisted.python.log import addObserver
+from twisted.python.log import addObserver, removeObserver
from twisted.python.usage import UsageError, Options
from twisted.python.reflect import namedAny
@@ -199,6 +199,8 @@
def run(self):
for obs in self.observers:
addObserver(obs.observe)
+ self.reactor.addSystemEventTrigger(
+ 'before', 'shutdown', removeObserver, obs.observe)
sim = self.createSimulator()
arrivalPolicy = self.createArrivalPolicy()
arrivalPolicy.run(sim)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110503/6340c0cd/attachment-0001.html>
More information about the calendarserver-changes
mailing list