[CalendarServer-changes] [4555] CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/ twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Thu Sep 24 14:01:08 PDT 2009
Revision: 4555
http://trac.macosforge.org/projects/calendarserver/changeset/4555
Author: sagen at apple.com
Date: 2009-09-24 14:01:05 -0700 (Thu, 24 Sep 2009)
Log Message:
-----------
Add an explicit "EnableConnectionInheriting" plist key, and a new LogID slave process command line arg which gets used instead of the port number within error.log and access.log (when connection inheriting is in affect).
Modified Paths:
--------------
CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/accesslog.py
CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/cluster.py
CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/config.py
CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/tap.py
Modified: CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/accesslog.py
===================================================================
--- CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/accesslog.py 2009-09-24 20:32:07 UTC (rev 4554)
+++ CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/accesslog.py 2009-09-24 21:01:05 UTC (rev 4555)
@@ -117,7 +117,10 @@
)
try:
- serverInstance = request.chanRequest.transport.server.port
+ if config.EnableConnectionInheriting:
+ serverInstance = config.LogID
+ else:
+ serverInstance = request.chanRequest.transport.server.port
except AttributeError:
serverInstance = "Unknown"
if config.EnableExtendedAccessLog:
Modified: CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/cluster.py
===================================================================
--- CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/cluster.py 2009-09-24 20:32:07 UTC (rev 4554)
+++ CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/cluster.py 2009-09-24 21:01:05 UTC (rev 4555)
@@ -112,6 +112,7 @@
'-o', 'BindAddresses=%s' % (','.join(self.interfaces),),
'-o', 'PIDFile=None',
'-o', 'ErrorLogFile=None',
+ '-o', 'LogID=%s' % (self.id,),
'-o', 'MultiProcess/ProcessCount=%d' % (
config.MultiProcess['ProcessCount'],)])
@@ -294,9 +295,8 @@
config.MultiProcess['LoadBalancer']['Enabled'] = False
bindAddress = config.BindAddresses
- elif not config.MultiProcess['LoadBalancer']['Enabled']:
- # We are multiprocess but not using load balancer, open the socket(s)
- # to be inherited by the slaves
+ elif config.EnableConnectionInheriting:
+ # Open the socket(s) to be inherited by the slaves
if not config.BindAddresses:
config.BindAddresses = [""]
Modified: CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/config.py
===================================================================
--- CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/config.py 2009-09-24 20:32:07 UTC (rev 4554)
+++ CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/config.py 2009-09-24 21:01:05 UTC (rev 4555)
@@ -100,6 +100,7 @@
"BindAddresses": [], # List of IP addresses to bind to [empty = all]
"BindHTTPPorts": [], # List of port numbers to bind to for HTTP [empty = same as "Port"]
"BindSSLPorts" : [], # List of port numbers to bind to for SSL [empty = same as "SSLPort"]
+ "EnableConnectionInheriting" : False,
"InheritFDs" : [], # File descriptors to inherit for HTTP requests (empty = don't inherit)
"InheritSSLFDs": [], # File descriptors to inherit for HTTPS requests (empty = don't inherit)
@@ -170,6 +171,7 @@
"EnableExtendedAccessLog" : True,
"DefaultLogLevel" : "",
"LogLevels" : {},
+ "LogID" : "",
"AccountingCategories": {
"iTIP": False,
Modified: CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/tap.py
===================================================================
--- CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/tap.py 2009-09-24 20:32:07 UTC (rev 4554)
+++ CalendarServer/branches/users/sagen/deployment-inherit-fds-4549/twistedcaldav/tap.py 2009-09-24 21:01:05 UTC (rev 4555)
@@ -714,7 +714,9 @@
# If inheriting file descriptors from the master, use those to handle
# requests instead of opening ports.
- if config.InheritFDs or config.InheritSSLFDs:
+ if (config.EnableConnectionInheriting and
+ (config.InheritFDs or config.InheritSSLFDs)):
+
for fd in config.InheritFDs:
fd = int(fd)
inheritedService = InheritTCPServer(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090924/9b264ab3/attachment.html>
More information about the calendarserver-changes
mailing list