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:
parent
8ad8c0abb3
commit
c03d53ab77
@ -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
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user