[CalendarServer-changes] [1516] CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops .patch

source_changes at macosforge.org source_changes at macosforge.org
Tue May 8 01:26:19 PDT 2007


Revision: 1516
          http://trac.macosforge.org/projects/calendarserver/changeset/1516
Author:   tfitz at apple.com
Date:     2007-05-08 01:26:19 -0700 (Tue, 08 May 2007)

Log Message:
-----------
Retry xattr set if it fails with EAGAIN.

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch

Modified: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch	2007-05-07 23:14:13 UTC (rev 1515)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.xattrprops.patch	2007-05-08 08:26:19 UTC (rev 1516)
@@ -2,7 +2,17 @@
 ===================================================================
 --- twisted/web2/dav/xattrprops.py	(revision 19773)
 +++ twisted/web2/dav/xattrprops.py	(working copy)
-@@ -66,16 +66,8 @@
+@@ -33,6 +33,9 @@
+ 
+ import urllib
+ import sys
++from time import sleep
++from random import random
++from errno import EAGAIN
+ 
+ import xattr
+ 
+@@ -66,16 +69,8 @@
          deadPropertyXattrPrefix = "user."
  
      def _encode(clazz, name):
@@ -21,3 +31,21 @@
          return r
  
      def _decode(clazz, name):
+@@ -109,7 +104,16 @@
+         return doc.root_element
+ 
+     def set(self, property):
+-        self.attrs[self._encode(property.qname())] = property.toxml()
++        for n in range(20):
++            try:
++                self.attrs[self._encode(property.qname())] = property.toxml()
++            except IOError, error:
++		if error.errno != EAGAIN:
++		    raise
++                sleep(random() / 10) # OMG Brutal Hax
++            else:
++                break
++    
+ 
+         # Update the resource because we've modified it
+         self.resource.fp.restat()

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


More information about the calendarserver-changes mailing list