[CalendarServer-changes] [3586] CalendarServer/trunk/twistedcaldav/method/report_multiget.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 12 11:51:36 PST 2009


Revision: 3586
          http://trac.macosforge.org/projects/calendarserver/changeset/3586
Author:   sagen at apple.com
Date:     2009-01-12 11:51:36 -0800 (Mon, 12 Jan 2009)
Log Message:
-----------
Race condition fix: a DELETE can remove a resource after the calendar-multiget code has already determined that resource exists.  In this case, we now return a 404 response for that resource within the multistatus.

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

Modified: CalendarServer/trunk/twistedcaldav/method/report_multiget.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/method/report_multiget.py	2009-01-12 15:37:38 UTC (rev 3585)
+++ CalendarServer/trunk/twistedcaldav/method/report_multiget.py	2009-01-12 19:51:36 UTC (rev 3586)
@@ -172,6 +172,14 @@
                 except ValueError:
                     log.err("Invalid calendar resource during multiget: %s" % (href,))
                     responses.append(davxml.StatusResponse(davxml.HRef.fromString(href), davxml.Status.fromResponseCode(responsecode.FORBIDDEN)))
+                except IOError:
+                    # This can happen because of a race-condition between the
+                    # time we determine which resources exist and the deletion
+                    # of one of these resources in another request.  In this
+                    # case, return a 404 for the now missing resource rather
+                    # than raise an error for the entire report.
+                    log.err("Missing calendar resource during multiget: %s" % (href,))
+                    responses.append(davxml.StatusResponse(davxml.HRef.fromString(href), davxml.Status.fromResponseCode(responsecode.NOT_FOUND)))
 
             # Indicate error for all valid non-readable resources
             for ignore_resource, href in bad_resources:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090112/2369ef21/attachment.html>


More information about the calendarserver-changes mailing list