Give spawn a cycle

This fixes an annoying race when running the reconstrcutor in
interactive mode on dev machine with not much in the way of data.

I'm not sure why.

Drive-By: kill useless continue

Closes-Bug: #1653174

Change-Id: I778c2a929d746ad88fa1ec1d1503d676a8b4ed61
This commit is contained in:
Clay Gerrard 2017-01-25 12:26:40 -08:00
parent 2914e04493
commit 5cd3095709

View File

@ -557,7 +557,6 @@ class ObjectReconstructor(Daemon):
self.logger.exception(
'Unable to purge DiskFile (%r %r %r)',
object_hash, timestamps['ts_data'], frag_index)
continue
def process_job(self, job):
"""
@ -911,11 +910,11 @@ class ObjectReconstructor(Daemon):
stats = spawn(self.heartbeat)
lockup_detector = spawn(self.detect_lockups)
sleep() # Give spawns a cycle
try:
self.run_pool = GreenPool(size=self.concurrency)
for part_info in self.collect_parts(**kwargs):
sleep() # Give spawns a cycle
if not self.check_ring(part_info['policy'].object_ring):
self.logger.info(_("Ring change detected. Aborting "
"current reconstruction pass."))