[CalendarServer-changes] [12876] CalendarServer/branches/release/CalendarServer-5.2-dev/twext/web2/ metafd.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Mar 12 11:07:52 PDT 2014
Revision: 12876
http://trac.calendarserver.org//changeset/12876
Author: cdaboo at apple.com
Date: 2014-03-12 11:07:51 -0700 (Wed, 12 Mar 2014)
Log Message:
-----------
Prevent exception when master is TERM'd.
Modified Paths:
--------------
CalendarServer/branches/release/CalendarServer-5.2-dev/twext/web2/metafd.py
Modified: CalendarServer/branches/release/CalendarServer-5.2-dev/twext/web2/metafd.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-5.2-dev/twext/web2/metafd.py 2014-03-11 01:16:42 UTC (rev 12875)
+++ CalendarServer/branches/release/CalendarServer-5.2-dev/twext/web2/metafd.py 2014-03-12 18:07:51 UTC (rev 12876)
@@ -446,8 +446,18 @@
self.limiter = limiter
self.maxAccepts = limiter.maxAccepts
self.maxRequests = limiter.maxRequests
+ self.stopping = False
+ def stopFactory(self):
+ """
+ Mark this factory as being stopped to prevent attempts to start reading on its
+ port again when the limiter statuses change during shutdown.
+ """
+ super(LimitingInheritingProtocolFactory, self).stopFactory()
+ self.stopping = True
+
+
def loadAboveMaximum(self):
"""
The current server load has exceeded the maximum allowable.
@@ -457,9 +467,11 @@
def loadNominal(self):
"""
- The current server load is nominal; proceed with reading requests.
+ The current server load is nominal; proceed with reading requests (but only if
+ the server itself is still running).
"""
- self.myServer.myPort.startReading()
+ if not self.stopping:
+ self.myServer.myPort.startReading()
@property
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/6bd87702/attachment.html>
More information about the calendarserver-changes
mailing list