Skip to content

Instantly share code, notes, and snippets.

commit b51f7d1d81179d7be105681adcde00d2fafed943
Author: Clay Gerrard <clay.gerrard@gmail.com>
Date: Thu Aug 27 15:09:29 2015 -0700
wip: fix tombstone purge
Change-Id: Ib9a42f412fb90d51959efce886c0f8952aba8d85
diff --git a/swift/obj/diskfile.py b/swift/obj/diskfile.py
index 51158a0..eb32703 100644
diff --git a/swift/common/internal_client.py b/swift/common/internal_client.py
index f6a22c8..07cd5df 100644
--- a/swift/common/internal_client.py
+++ b/swift/common/internal_client.py
@@ -15,7 +15,6 @@
from eventlet import sleep, Timeout
import json
-from paste.deploy import loadapp
import struct
diff --git a/swift/obj/server.py b/swift/obj/server.py
index 4ce53dd..ddca987 100644
--- a/swift/obj/server.py
+++ b/swift/obj/server.py
@@ -510,8 +510,12 @@ class ObjectController(object):
pass
response.headers['X-Timestamp'] = file_x_ts
resp = request.get_response(response)
- except (DiskFileNotExist, DiskFileQuarantined):
- resp = HTTPNotFound(request=request, conditional_response=True)
diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py
index aecc752..79ce477 100644
--- a/swift/proxy/controllers/obj.py
+++ b/swift/proxy/controllers/obj.py
@@ -658,6 +658,7 @@ class ObjectController(Controller):
return HTTPServiceUnavailable(request=req)
bytes_transferred = 0
try:
+ req_failed = False
with ContextPool(len(nodes)) as pool:
diff --git a/test/unit/obj/test_server.py b/test/unit/obj/test_server.py
index 074bba6..e85ec45 100755
--- a/test/unit/obj/test_server.py
+++ b/test/unit/obj/test_server.py
@@ -661,6 +661,23 @@ class TestObjectController(unittest.TestCase):
resp = req.get_response(self.object_controller)
self.assertEquals(resp.status_int, 408)
+ def test_slow_client_timeout(self):
+ def exploding_iter():
import os
import time
from swiftclient import client
def body_iter(body, chunk_size=64):
backoff = 60
for i in range(len(body)):
chunk = body[i:i + chunk_size]
diff --git a/swift/obj/ssync_receiver.py b/swift/obj/ssync_receiver.py
index b3c9067..2ece089 100644
--- a/swift/obj/ssync_receiver.py
+++ b/swift/obj/ssync_receiver.py
@@ -225,12 +225,12 @@ class Receiver(object):
if not line or line.strip() == ':MISSING_CHECK: END':
break
msg_parms = [urllib.unquote(v) for v in line.split()]
- if len(msg_parms) == 3:
- (object_hash, timestamp, policy_idx) = msg_parms
diff --git a/test/probe/test_object_handoff.py b/test/probe/test_object_handoff.py
index 565b2ff..6b9bc8e 100755
--- a/test/probe/test_object_handoff.py
+++ b/test/probe/test_object_handoff.py
@@ -14,16 +14,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+
from unittest import main, TestCase
diff --git a/swift/container/server.py b/swift/container/server.py
index eb72513..8069d20 100644
--- a/swift/container/server.py
+++ b/swift/container/server.py
@@ -229,9 +229,13 @@ class ContainerController(object):
broker = self._get_container_broker(drive, part, account, container)
if account.startswith(self.auto_create_account_prefix) and obj and \
not os.path.exists(broker.db_file):
+ requested_policy_index = (self.get_and_validate_policy_index(req)
+ or self.policies.default.idx)
diff --git a/swift/container/server.py b/swift/container/server.py
index a7314b8..49deb30 100644
--- a/swift/container/server.py
+++ b/swift/container/server.py
@@ -326,7 +326,7 @@ class ContainerController(object):
# We've just revived a deleted container: the database is
# there, but it was marked deleted. We need to update its
# storage policy index.
- broker.set_storage_policy_index(requested_policy_index)
+ broker.set_storage_policy_index(new_container_policy)