when processing node updates, don't wait on the node in cases it should be stopped (#834)

In situations when the node should be done, mark it as done without
waiting for the node to respond to the Done command.
This commit is contained in:
bmc-msft
2021-04-26 15:19:46 -04:00
committed by GitHub
parent fde43a3921
commit f4b5c1ae73

View File

@ -217,7 +217,7 @@ class Node(BASE_NODE, ORMMixin):
"node: stopping busy node with all tasks complete: %s", "node: stopping busy node with all tasks complete: %s",
self.machine_id, self.machine_id,
) )
self.stop() self.stop(done=True)
return True return True
def mark_tasks_stopped_early(self, error: Optional[Error] = None) -> None: def mark_tasks_stopped_early(self, error: Optional[Error] = None) -> None:
@ -253,7 +253,7 @@ class Node(BASE_NODE, ORMMixin):
self.version, self.version,
__version__, __version__,
) )
self.stop() self.stop(done=True)
return False return False
if self.state in NodeState.ready_for_reset(): if self.state in NodeState.ready_for_reset():
@ -267,7 +267,7 @@ class Node(BASE_NODE, ORMMixin):
"can_schedule is set to be deleted. machine_id:%s", "can_schedule is set to be deleted. machine_id:%s",
self.machine_id, self.machine_id,
) )
self.stop() self.stop(done=True)
return False return False
if self.reimage_requested: if self.reimage_requested:
@ -275,7 +275,7 @@ class Node(BASE_NODE, ORMMixin):
"can_schedule is set to be reimaged. machine_id:%s", "can_schedule is set to be reimaged. machine_id:%s",
self.machine_id, self.machine_id,
) )
self.stop() self.stop(done=True)
return False return False
if self.could_shrink_scaleset(): if self.could_shrink_scaleset():