Commits

Wes Winham committed b635b61

Added exception handling for concurrent bucket ACl modifications problems and ignored them if not in DEBUG

Comments (0)

Files changed (1)

storages/backends/s3boto.py

     def bucket(self):
         if not self._bucket:
             self._bucket = self._get_or_create_bucket(self._bucket_name)
-            self._bucket.set_acl(self.bucket_acl)
+            try:
+                self._bucket.set_acl(self.bucket_acl)
+            except S3ResponseError:
+                # Sometimes concurrent connections attempting to modify an ACL
+                # causes a 409 conflict error.
+                if settings.DEBUG:
+                    raise
         return self._bucket
 
     def _get_access_keys(self):