diff --git a/pvcd/NodeInstance.py b/pvcd/NodeInstance.py index f23b1d8f..b88a2acc 100644 --- a/pvcd/NodeInstance.py +++ b/pvcd/NodeInstance.py @@ -64,11 +64,12 @@ class NodeInstance(): # toggle state management of this node if self.name == self.this_node: if self.domain_state == 'flush' and self.inflush == False: - self.flush() + # Do flushing in a thread so it doesn't block the migrates out + flush_thread = threading.Thread(target=flush, args=(self), kwargs={}) + flush_thread.start() if self.domain_state == 'unflush' and self.inflush == False: self.unflush() - @zk_conn.DataWatch('/nodes/{}/memfree'.format(self.name)) def watch_hypervisor_memfree(data, stat, event=""): try: