From fb97a79acab4ce9cd297477349a1ce57e6624e58 Mon Sep 17 00:00:00 2001 From: Jim Ladd Date: Wed, 21 Apr 2021 21:28:32 -0700 Subject: [PATCH] add clarifying comment re: AUTOMATION_ANALYTICS_LAST_GATHER being set regardless --- awx/main/analytics/core.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/awx/main/analytics/core.py b/awx/main/analytics/core.py index 239a9d6622..67295f534b 100644 --- a/awx/main/analytics/core.py +++ b/awx/main/analytics/core.py @@ -278,6 +278,14 @@ def gather(dest=None, module=None, subset=None, since=None, until=None, collecti os.remove(fpath) with disable_activity_stream(): if not settings.AUTOMATION_ANALYTICS_LAST_GATHER or until > settings.AUTOMATION_ANALYTICS_LAST_GATHER: + # `AUTOMATION_ANALYTICS_LAST_GATHER` is set whether collection succeeds or fails; + # if collection fails because of a persistent, underlying issue and we do not set last_gather, + # we risk the collectors hitting an increasingly greater workload while the underlying issue + # remains unresolved. Put simply, if collection fails, we just move on. + + # All that said, `AUTOMATION_ANALYTICS_LAST_GATHER` plays a much smaller role in determining + # what is actually collected than it used to; collectors now mostly rely on their respective entry + # under `last_entries` to determine what should be collected. settings.AUTOMATION_ANALYTICS_LAST_GATHER = until shutil.rmtree(dest, ignore_errors=True) # clean up individual artifact files