Make sender wait dynamic based on receiver

This commit is contained in:
Joshua Boniface 2020-10-21 14:43:54 -04:00
parent 28abb018e3
commit 890023cbfc
1 changed files with 4 additions and 3 deletions

View File

@ -520,8 +520,9 @@ class VMInstance(object):
lock.release()
self.logger.out('Released read lock for synchronization phase D', state='o', prefix='Domain {}'.format(self.domuuid))
# Wait 1 second for everything to stabilize before we declare all-done and release locks
time.sleep(1)
# Wait for the receive side to complete before we declare all-done and release locks
while zkhandler.readdata(self.zk_conn, '/locks/domain_migrate/{}'.format(self.domuuid)) != '':
time.sleep(0.5)
migrate_lock_node.release()
migrate_lock_state.release()
@ -610,8 +611,8 @@ class VMInstance(object):
self.logger.out('Releasing write lock for synchronization phase D', state='i', prefix='Domain {}'.format(self.domuuid))
lock.release()
self.logger.out('Released write lock for synchronization phase D', state='o', prefix='Domain {}'.format(self.domuuid))
zkhandler.writedata(self.zk_conn, { '/locks/domain_migrate/{}'.format(self.domuuid): '' })
zkhandler.writedata(self.zk_conn, { '/locks/domain_migrate/{}'.format(self.domuuid): '' })
self.inreceive = False
return