It gets even more "interesting"... it appears as if when I turn off the Calendar service (from server.app), caldavd starts and vice versa.
For example I turn off and the error log shows "16:45:35 Server Shut Down?. 7 seconds later the log is re-opened and twistd is starting up, followed by all the instances of caldav.
A couple of minutes later I get:
013-07-09 16:56:50-0700 [-] [caldav-0] [-] Unhandled Error
2013-07-09 16:56:50-0700 [-] [caldav-0] Traceback (most recent call last):
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/log.py", line 69, in callWithContext
2013-07-09 16:56:50-0700 [-] [caldav-0] return context.call({ILogContext: newCtx}, func, *args, **kw)
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/context.py", line 118, in callWithContext
2013-07-09 16:56:50-0700 [-] [caldav-0] return self.currentContext().callWithContext(ctx, func, *args, **kw)
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/context.py", line 81, in callWithContext
2013-07-09 16:56:50-0700 [-] [caldav-0] return func(*args,**kw)
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twext/internet/kqreactor.py", line 206, in _doWriteOrRead
2013-07-09 16:56:50-0700 [-] [caldav-0] why = selectable.doRead()
2013-07-09 16:56:50-0700 [-] [caldav-0] --- <exception caught here> ---
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twext/internet/sendfdport.py", line 295, in doRead
2013-07-09 16:56:50-0700 [-] [caldav-0] description, protocol)
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twext/web2/metafd.py", line 103, in createTransport
2013-07-09 16:56:50-0700 [-] [caldav-0] transport.startTLS(self.contextFactory)
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/_newtls.py", line 178, in startTLS
2013-07-09 16:56:50-0700 [-] [caldav-0] startTLS(self, ctx, normal, FileDescriptor)
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/_newtls.py", line 138, in startTLS
2013-07-09 16:56:50-0700 [-] [caldav-0] tlsFactory = TLSMemoryBIOFactory(contextFactory, client, None)
2013-07-09 16:56:50-0700 [-] [caldav-0] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/protocols/tls.py", line 594, in __init__
2013-07-09 16:56:50-0700 [-] [caldav-0] contextFactory.getContext()
2013-07-09 16:56:50-0700 [-] [caldav-0] exceptions.AttributeError: 'NoneType' object has no attribute 'getContext'
2013-07-09 16:56:50-0700 [-] [caldav-0]
This repeates for all the instances of caldav.
10 minutes later I turned on the service. It sent SIGTERMs to all the instances, and I saw
2013-07-09 17:10:29-0700 [twisted.internet.protocol.Factory] (TCP Port 7654 Closed)
2013-07-09 17:10:29-0700 [-] Main loop terminated.
2013-07-09 17:10:29-0700 [-] Server Shut Down.
6 seconds later twistd and caldav started again with these errors:
2013-07-09 17:10:29-0700 [-] [caldav-1] [HTTPChannel,1,192.168.1.80] Unhandled Error
2013-07-09 17:10:29-0700 [-] [caldav-1] Traceback (most recent call last):
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/defer.py", line 290, in addCallbacks
2013-07-09 17:10:29-0700 [-] [caldav-1] self._runCallbacks()
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/defer.py", line 551, in _runCallbacks
2013-07-09 17:10:29-0700 [-] [caldav-1] current.result = callback(current.result, *args, **kw)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/base.py", line 426, in _continueFiring
2013-07-09 17:10:29-0700 [-] [caldav-1] callable(*args, **kwargs)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/base.py", line 621, in disconnectAll
2013-07-09 17:10:29-0700 [-] [caldav-1] failure.Failure(main.CONNECTION_LOST))
2013-07-09 17:10:29-0700 [-] [caldav-1] --- <exception caught here> ---
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/log.py", line 84, in callWithLogger
2013-07-09 17:10:29-0700 [-] [caldav-1] return callWithContext({"system": lp}, func, *args, **kw)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/log.py", line 69, in callWithContext
2013-07-09 17:10:29-0700 [-] [caldav-1] return context.call({ILogContext: newCtx}, func, *args, **kw)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/context.py", line 118, in callWithContext
2013-07-09 17:10:29-0700 [-] [caldav-1] return self.currentContext().callWithContext(ctx, func, *args, **kw)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/context.py", line 81, in callWithContext
2013-07-09 17:10:29-0700 [-] [caldav-1] return func(*args,**kw)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twext/backport/internet/tcp.py", line 281, in connectionLost
2013-07-09 17:10:29-0700 [-] [caldav-1] protocol.connectionLost(reason)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twext/web2/channel/http.py", line 976, in connectionLost
2013-07-09 17:10:29-0700 [-] [caldav-1] self.factory.removeConnectedChannel(self)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twext/web2/metafd.py", line 142, in removeConnectedChannel
2013-07-09 17:10:29-0700 [-] [caldav-1] HTTPFactory.removeConnectedChannel(self, channel)
2013-07-09 17:10:29-0700 [-] [caldav-1] File "/Applications/Server.app/Contents/ServerRoot/usr/share/caldavd/lib/python/twext/web2/channel/http.py", line 1053, in removeConnectedChannel
2013-07-09 17:10:29-0700 [-] [caldav-1] self.connectedChannels.remove(channel)
2013-07-09 17:10:29-0700 [-] [caldav-1] exceptions.KeyError: <twext.web2.channel.http.HTTPChannel object at 0x103e6b550>
2013-07-09 17:10:29-0700 [-] [caldav-1]
2013-07-09 17:10:29-0700 [-] [caldav-1] [-] Main loop terminated.
Needless to say, I have absolutely no idea what's going on at this point :-)