Move lock release to phase D
This commit is contained in:
parent
82b4d3ed1b
commit
017953c2e6
|
@ -503,11 +503,6 @@ class VMInstance(object):
|
||||||
if do_migrate_shutdown:
|
if do_migrate_shutdown:
|
||||||
migrate_shutdown_result = migrate_shutdown()
|
migrate_shutdown_result = migrate_shutdown()
|
||||||
|
|
||||||
self.last_currentnode = zkhandler.readdata(self.zk_conn, '/domains/{}/node'.format(self.domuuid))
|
|
||||||
self.last_lastnode = zkhandler.readdata(self.zk_conn, '/domains/{}/lastnode'.format(self.domuuid))
|
|
||||||
|
|
||||||
migrate_lock_state.release()
|
|
||||||
|
|
||||||
self.logger.out('Releasing write lock for synchronization phase C', state='i', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Releasing write lock for synchronization phase C', state='i', prefix='Domain {}'.format(self.domuuid))
|
||||||
lock.release()
|
lock.release()
|
||||||
self.logger.out('Released write lock for synchronization phase C', state='o', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Released write lock for synchronization phase C', state='o', prefix='Domain {}'.format(self.domuuid))
|
||||||
|
@ -517,6 +512,10 @@ class VMInstance(object):
|
||||||
self.logger.out('Acquiring read lock for synchronization phase D', state='i', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Acquiring read lock for synchronization phase D', state='i', prefix='Domain {}'.format(self.domuuid))
|
||||||
lock.acquire()
|
lock.acquire()
|
||||||
self.logger.out('Acquired read lock for synchronization phase D', state='o', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Acquired read lock for synchronization phase D', state='o', prefix='Domain {}'.format(self.domuuid))
|
||||||
|
|
||||||
|
self.last_currentnode = zkhandler.readdata(self.zk_conn, '/domains/{}/node'.format(self.domuuid))
|
||||||
|
self.last_lastnode = zkhandler.readdata(self.zk_conn, '/domains/{}/lastnode'.format(self.domuuid))
|
||||||
|
|
||||||
self.logger.out('Releasing read lock for synchronization phase D', state='i', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Releasing read lock for synchronization phase D', state='i', prefix='Domain {}'.format(self.domuuid))
|
||||||
lock.release()
|
lock.release()
|
||||||
self.logger.out('Released read lock for synchronization phase D', state='o', prefix='Domain {}'.format(self.domuuid))
|
self.logger.out('Released read lock for synchronization phase D', state='o', prefix='Domain {}'.format(self.domuuid))
|
||||||
|
@ -524,6 +523,8 @@ class VMInstance(object):
|
||||||
# Wait 0.5 seconds for everything to stabilize before we declare all-done
|
# Wait 0.5 seconds for everything to stabilize before we declare all-done
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
migrate_lock_node.release()
|
migrate_lock_node.release()
|
||||||
|
migrate_lock_state.release()
|
||||||
|
|
||||||
self.inmigrate = False
|
self.inmigrate = False
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue