Skip to content

Commit

Permalink
Applies the big hammer to ensure that the output of show_status in the
Browse files Browse the repository at this point in the history
runtime context never throws an error.

This will prevent all classes of error resulting from a status call
during controller destruction.
  • Loading branch information
manadart committed Sep 20, 2021
1 parent 44cbe0e commit db5bb11
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions acceptancetests/deploy_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,11 +1086,15 @@ def runtime_context(self, addable_machines):
self.client.list_controllers()
self.client.list_models()

# Only show status for models the backend is tracking.
# This prevents errors attempting to retrieve status for
# models that have been issued a destroy command.
for m_client in self.client._backend.added_models:
m_client.show_status()
# Never let emission of model status constitute an error.
# Controllers in various stages of teardown can cause a
# race here.
for m_client in self.client.iter_model_clients():
try:
m_client.show_status()
except Exception as e:
logging.info("Exception calling status on tracked model: {}".format(e))

finally:
with self.client.ignore_soft_deadline():
with self.tear_down_client.ignore_soft_deadline():
Expand Down

0 comments on commit db5bb11

Please sign in to comment.