diff --git a/swift/proxy/controllers/base.py b/swift/proxy/controllers/base.py index 1e55264045..a5983a93d4 100644 --- a/swift/proxy/controllers/base.py +++ b/swift/proxy/controllers/base.py @@ -920,7 +920,6 @@ class ResumingGetter(object): if nchunks % 5 == 0: sleep() - part_iter = None try: while True: start_byte, end_byte, length, headers, part = \ @@ -932,10 +931,6 @@ class ResumingGetter(object): 'entity_length': length, 'headers': headers, 'part_iter': part_iter} self.pop_range() - except GeneratorExit: - if part_iter: - part_iter.close() - raise except StopIteration: req.environ['swift.non_client_disconnect'] = True diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index 92d76eb418..87d3b5241c 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -1428,6 +1428,7 @@ class ECAppIter(object): finally: queue.resize(2) # ensure there's room queue.put(None) + frag_iter.close() with ContextPool(len(fragment_iters)) as pool: for frag_iter, queue in zip(fragment_iters, queues):