[CalendarServer-changes] [1697] CalendarServer/trunk/twistedcaldav/method/report_common.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Jul 20 11:45:34 PDT 2007


Revision: 1697
          http://trac.macosforge.org/projects/calendarserver/changeset/1697
Author:   cdaboo at apple.com
Date:     2007-07-20 11:45:33 -0700 (Fri, 20 Jul 2007)

Log Message:
-----------
Fix race-condition where a resource is being modified as a free-busy report is being done.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/method/report_common.py

Modified: CalendarServer/trunk/twistedcaldav/method/report_common.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/report_common.py	2007-07-20 14:52:12 UTC (rev 1696)
+++ CalendarServer/trunk/twistedcaldav/method/report_common.py	2007-07-20 18:45:33 UTC (rev 1697)
@@ -341,8 +341,14 @@
             continue
 
         calendar = calresource.iCalendar(name)
-        assert calendar is not None, "Calendar %s is missing from calendar collection %r" % (name, calresource)
         
+        # The calendar may come back as None if the resource is being changed, or was deleted
+        # between our initial index query and getting here. For now we will ignore this errror, but in
+        # the longer term we need to simplement some form of locking, perhaps.
+        if calendar is None:
+            log.err("Calendar %s is missing from calendar collection %r" % (name, calresource))
+            continue
+        
         # Ignore ones of this UID
         if excludeuid:
             # See if we have a UID match

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070720/a8ee7bff/attachment.html


More information about the calendarserver-changes mailing list