Further resiliency changes focused on offline database

Make logs from database outage more manageable

Raise exception if update_model never recovers from problem
This commit is contained in:
Alan Rominger
2022-07-15 14:09:39 -04:00
parent 85a5b58d18
commit 30f556f845
6 changed files with 85 additions and 13 deletions

View File

@@ -95,8 +95,13 @@ class Command(BaseCommand):
# database migrations are still running
from awx.main.models.ha import Instance
executor = MigrationExecutor(connection)
migrating = bool(executor.migration_plan(executor.loader.graph.leaf_nodes()))
try:
executor = MigrationExecutor(connection)
migrating = bool(executor.migration_plan(executor.loader.graph.leaf_nodes()))
except Exception as exc:
logger.info(f'Error on startup of run_wsbroadcast (error: {exc}), retry in 10s...')
time.sleep(10)
return
# In containerized deployments, migrations happen in the task container,
# and the services running there don't start until migrations are