From 530977d6b3d5fbd8d0fd80b46518d43c302f4888 Mon Sep 17 00:00:00 2001 From: Alexander Komarov Date: Thu, 19 Aug 2021 14:48:11 +0500 Subject: [PATCH] Set default value is 0 for idle_timeout --- awx/main/conf.py | 7 +++++-- awx/main/tasks.py | 4 +++- .../src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.js | 2 +- .../Setting/Jobs/JobsEdit/data.defaultJobSettings.json | 2 +- .../src/screens/Setting/shared/data.allSettingOptions.json | 6 +++--- awx/ui/src/screens/Setting/shared/data.allSettings.json | 2 +- awx/ui/src/screens/Setting/shared/data.jobSettings.json | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/awx/main/conf.py b/awx/main/conf.py index ed15ea2ddb..cfe7ebe80d 100644 --- a/awx/main/conf.py +++ b/awx/main/conf.py @@ -412,9 +412,12 @@ register( 'DEFAULT_JOB_IDLE_TIMEOUT', field_class=fields.IntegerField, min_value=0, - default=600, + default=0, label=_('Default Job Idle Timeout'), - help_text=_('If no output is detected from ansible in this number of seconds the execution will be terminated.'), + help_text=_( + 'If no output is detected from ansible in this number of seconds the execution will be terminated. ' + 'Use value of 0 to used default idle_timeout is 600s.' + ), category=_('Jobs'), category_slug='jobs', unit=_('seconds'), diff --git a/awx/main/tasks.py b/awx/main/tasks.py index f61f2847e7..83b7d9bd69 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1365,11 +1365,13 @@ class BaseTask(object): 'envvars': env, 'settings': { 'job_timeout': self.get_instance_timeout(self.instance), - 'idle_timeout': settings.DEFAULT_JOB_IDLE_TIMEOUT, 'suppress_ansible_output': True, }, } + if settings.DEFAULT_JOB_IDLE_TIMEOUT > 0: + params['settings']['idle_timeout'] = settings.DEFAULT_JOB_IDLE_TIMEOUT + if isinstance(self.instance, AdHocCommand): params['module'] = self.build_module_name(self.instance) params['module_args'] = self.build_module_args(self.instance) diff --git a/awx/ui/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.js b/awx/ui/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.js index 0c0b6e019a..9b0dda4233 100644 --- a/awx/ui/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.js +++ b/awx/ui/src/screens/Setting/Jobs/JobsDetail/JobsDetail.test.js @@ -64,7 +64,7 @@ describe('', () => { ); assertDetail(wrapper, 'Maximum Scheduled Jobs', '10'); assertDetail(wrapper, 'Default Job Timeout', '0 seconds'); - assertDetail(wrapper, 'Default Job Idle Timeout', '600 seconds'); + assertDetail(wrapper, 'Default Job Idle Timeout', '0 seconds'); assertDetail(wrapper, 'Default Inventory Update Timeout', '0 seconds'); assertDetail(wrapper, 'Default Project Update Timeout', '0 seconds'); assertDetail(wrapper, 'Per-Host Ansible Fact Cache Timeout', '0 seconds'); diff --git a/awx/ui/src/screens/Setting/Jobs/JobsEdit/data.defaultJobSettings.json b/awx/ui/src/screens/Setting/Jobs/JobsEdit/data.defaultJobSettings.json index 9ee56e2d45..749249494a 100644 --- a/awx/ui/src/screens/Setting/Jobs/JobsEdit/data.defaultJobSettings.json +++ b/awx/ui/src/screens/Setting/Jobs/JobsEdit/data.defaultJobSettings.json @@ -30,7 +30,7 @@ "AWX_TASK_ENV": {}, "DEFAULT_INVENTORY_UPDATE_TIMEOUT": 0, "DEFAULT_JOB_TIMEOUT": 0, - "DEFAULT_JOB_IDLE_TIMEOUT": 600, + "DEFAULT_JOB_IDLE_TIMEOUT": 0, "DEFAULT_PROJECT_UPDATE_TIMEOUT": 0, "GALAXY_IGNORE_CERTS": false, "MAX_FORKS": 200, diff --git a/awx/ui/src/screens/Setting/shared/data.allSettingOptions.json b/awx/ui/src/screens/Setting/shared/data.allSettingOptions.json index fb56892906..ff176e0661 100644 --- a/awx/ui/src/screens/Setting/shared/data.allSettingOptions.json +++ b/awx/ui/src/screens/Setting/shared/data.allSettingOptions.json @@ -344,12 +344,12 @@ "type": "integer", "required": false, "label": "Default Job Idle Timeout", - "help_text": "If no output is detected from ansible in this number of seconds the execution will be terminated.", + "help_text": "If no output is detected from ansible in this number of seconds the execution will be terminated. Use value of 0 to used default idle_timeout is 600s.", "min_value": 0, "category": "Jobs", "category_slug": "jobs", "unit": "seconds", - "default": 600 + "default": 0 }, "DEFAULT_INVENTORY_UPDATE_TIMEOUT": { "type": "integer", @@ -4001,7 +4001,7 @@ "DEFAULT_JOB_IDLE_TIMEOUT": { "type": "integer", "label": "Default Job Idle Timeout", - "help_text": "If no output is detected from ansible in this number of seconds the execution will be terminated.", + "help_text": "If no output is detected from ansible in this number of seconds the execution will be terminated. Use value of 0 to used default idle_timeout is 600s.", "min_value": 0, "category": "Jobs", "category_slug": "jobs", diff --git a/awx/ui/src/screens/Setting/shared/data.allSettings.json b/awx/ui/src/screens/Setting/shared/data.allSettings.json index 21ef240e2d..c33a93eccf 100644 --- a/awx/ui/src/screens/Setting/shared/data.allSettings.json +++ b/awx/ui/src/screens/Setting/shared/data.allSettings.json @@ -49,7 +49,7 @@ "SCHEDULE_MAX_JOBS":10, "AWX_ANSIBLE_CALLBACK_PLUGINS":[], "DEFAULT_JOB_TIMEOUT":0, - "DEFAULT_JOB_IDLE_TIMEOUT":600, + "DEFAULT_JOB_IDLE_TIMEOUT":0, "DEFAULT_INVENTORY_UPDATE_TIMEOUT":0, "DEFAULT_PROJECT_UPDATE_TIMEOUT":0, "ANSIBLE_FACT_CACHE_TIMEOUT":0, diff --git a/awx/ui/src/screens/Setting/shared/data.jobSettings.json b/awx/ui/src/screens/Setting/shared/data.jobSettings.json index 9ac0a27228..1815cc12b7 100644 --- a/awx/ui/src/screens/Setting/shared/data.jobSettings.json +++ b/awx/ui/src/screens/Setting/shared/data.jobSettings.json @@ -17,7 +17,7 @@ "SCHEDULE_MAX_JOBS": 10, "AWX_ANSIBLE_CALLBACK_PLUGINS": [], "DEFAULT_JOB_TIMEOUT": 0, - "DEFAULT_JOB_IDLE_TIMEOUT": 600, + "DEFAULT_JOB_IDLE_TIMEOUT": 0, "DEFAULT_INVENTORY_UPDATE_TIMEOUT": 0, "DEFAULT_PROJECT_UPDATE_TIMEOUT": 0, "ANSIBLE_FACT_CACHE_TIMEOUT": 0,