[CalendarServer-changes] [8173] CalendarServer/branches/users/glyph/shared-pool-take2/twext/ enterprise/adbapi2.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Oct 10 08:05:42 PDT 2011


Revision: 8173
          http://trac.macosforge.org/projects/calendarserver/changeset/8173
Author:   glyph at apple.com
Date:     2011-10-10 08:05:42 -0700 (Mon, 10 Oct 2011)
Log Message:
-----------
docs for failsafeResponder

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py

Modified: CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py
===================================================================
--- CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py	2011-10-10 15:05:31 UTC (rev 8172)
+++ CalendarServer/branches/users/glyph/shared-pool-take2/twext/enterprise/adbapi2.py	2011-10-10 15:05:42 UTC (rev 8173)
@@ -1064,12 +1064,19 @@
 
 
 def failsafeResponder(command):
+    """
+    Wrap an AMP command responder in some fail-safe logic, to make it so that
+    unknown errors won't drop the connection, as AMP's default behavior would.
+    """
     def wrap(inner):
         @inlineCallbacks
         def innerinner(*a, **k):
             try:
                 val = yield inner(*a, **k)
             except:
+                # FIXME: if this were a general thing, it should probably allow
+                # known errors through; look at the command's 'errors' attribute
+                # before collapsing into FailsafeException.
                 log.err(Failure(),
                         "shared database connection pool encountered error")
                 raise FailsafeException()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111010/909e1924/attachment-0001.html>


More information about the calendarserver-changes mailing list