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

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


Revision: 9965
          http://trac.calendarserver.org//changeset/9965
Author:   glyph at apple.com
Date:     2012-10-22 16:09:17 -0700 (Mon, 22 Oct 2012)
Log Message:
-----------
Just log it.  A temporary workaround.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/always-abort-txn-on-error/txdav/base/propertystore/sql.py

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

Modified: CalendarServer/branches/users/glyph/always-abort-txn-on-error/txdav/base/propertystore/sql.py
===================================================================
--- CalendarServer/branches/users/glyph/always-abort-txn-on-error/txdav/base/propertystore/sql.py	2012-10-22 23:09:16 UTC (rev 9964)
+++ CalendarServer/branches/users/glyph/always-abort-txn-on-error/txdav/base/propertystore/sql.py	2012-10-22 23:09:17 UTC (rev 9965)
@@ -30,6 +30,8 @@
     Select, Parameter, Update, Insert, TableSyntax, Delete)
 
 from txdav.xml.parser import WebDAVDocument
+from txdav.common.icommondatastore import AllRetriesFailed
+from twext.python.log import LoggingMixIn
 from txdav.common.datastore.sql_tables import schema
 from txdav.base.propertystore.base import (AbstractPropertyStore,
                                            PropertyName, validKey)
@@ -39,7 +41,7 @@
 
 prop = schema.RESOURCE_PROPERTY
 
-class PropertyStore(AbstractPropertyStore):
+class PropertyStore(AbstractPropertyStore, LoggingMixIn):
 
     _cacher = Memcacher("SQL.props", pickle=True, key_normalization=False)
 
@@ -255,7 +257,10 @@
         if hasattr(self, "_notifyCallback") and self._notifyCallback is not None:
             self._notifyCallback()
 
-        self._txn.subtransaction(trySetItem)
+        def justLogIt(f):
+            f.trap(AllRetriesFailed)
+            self.log_error("setting a property failed; probably nothing.")
+        self._txn.subtransaction(trySetItem).addErrback(justLogIt)
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20121022/2f2d12cb/attachment.html>


More information about the calendarserver-changes mailing list