[CalendarServer-changes] [9962] CalendarServer/branches/users/glyph/always-abort-txn-on-error

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 22 16:09:16 PDT 2012


Revision: 9962
          http://trac.calendarserver.org//changeset/9962
Author:   glyph at apple.com
Date:     2012-10-22 16:09:15 -0700 (Mon, 22 Oct 2012)
Log Message:
-----------
Get rid of transactionError() and just always abort transactions upon exceptions.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcalendar.py
    CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcol.py
    CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/resource.py
    CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/storebridge.py

Property Changed:
----------------
    CalendarServer/branches/users/glyph/always-abort-txn-on-error/

Modified: CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcalendar.py
===================================================================
--- CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcalendar.py	2012-10-22 23:09:15 UTC (rev 9961)
+++ CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcalendar.py	2012-10-22 23:09:15 UTC (rev 9962)
@@ -106,7 +106,6 @@
     
         if got_an_error:
             # Force a transaction error and proper clean-up
-            self.transactionError()
             errors.error()
             raise HTTPError(MultiStatusResponse([errors.response()]))
         

Modified: CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcol.py
===================================================================
--- CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcol.py	2012-10-22 23:09:15 UTC (rev 9961)
+++ CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/method/mkcol.py	2012-10-22 23:09:15 UTC (rev 9962)
@@ -182,7 +182,6 @@
 
         if got_an_error:
             # Clean up
-            self.transactionError()
             errors.error()
             raise HTTPError(Response(
                     code=responsecode.FORBIDDEN,

Modified: CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/resource.py
===================================================================
--- CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/resource.py	2012-10-22 23:09:15 UTC (rev 9961)
+++ CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/resource.py	2012-10-22 23:09:15 UTC (rev 9962)
@@ -318,8 +318,14 @@
         otherResource.associateWithTransaction(self._associatedTransaction)
 
 
-    def transactionError(self):
+    def methodRaisedException(self, failure):
+        """
+        An C{http_METHOD} method raised an exception.  Any type of exception,
+        including those that result in perfectly valid HTTP responses, should
+        abort the transaction.
+        """
         self._transactionError = True
+        return super(CalDAVResource, self).methodRaisedException(failure)
 
 
     @inlineCallbacks

Modified: CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/storebridge.py
===================================================================
--- CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/storebridge.py	2012-10-22 23:09:15 UTC (rev 9961)
+++ CalendarServer/branches/users/glyph/always-abort-txn-on-error/twistedcaldav/storebridge.py	2012-10-22 23:09:15 UTC (rev 9962)
@@ -1611,8 +1611,6 @@
             yield readStream(request.stream, t.write)
         except Exception, e:
             log.error("Unable to store attachment: %s" % (e,))
-            # Signal to abort in twistedcaldav.resource.CalDAVResource.RenderHTTP
-            self.transactionError()
             raise HTTPError(SERVICE_UNAVAILABLE)
 
         try:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121022/cc784657/attachment-0001.html>


More information about the calendarserver-changes mailing list