Close EC fragment iterators in the GreenThread that's consuming them

Otherwise, we might try to close them while they're already running.
This should prevent conditional SLO requests from returning 500 when
they should have returned 304 or 412.

Change-Id: I075a892f901c18ab5c178c9c4a2f367b76ae78e2
Related-Change: I156d873c72c19623bcfbf39bf120c98800b3cada
This commit is contained in:
Tim Burke 2015-11-04 12:25:19 -08:00
parent 8ad8c0abb3
commit c03d53ab77
2 changed files with 1 additions and 5 deletions

View File

@ -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

View File

@ -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):