From 0d66e24a0511cbab39f3ef4d504251dedf1399a7 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Thu, 19 Dec 2019 12:13:17 -0500 Subject: [PATCH] make dnf timeout configurable --- module_build_service/config.py | 7 ++++++- module_build_service/scheduler/default_modules.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module_build_service/config.py b/module_build_service/config.py index ba702e2a..6bffc751 100644 --- a/module_build_service/config.py +++ b/module_build_service/config.py @@ -661,7 +661,12 @@ class Config(object): "desc": "The minrate configuration on a DNF repo. This configuration will cause DNF to " "timeout loading a repo if the download speed is below minrate for the " "duration of the timeout." - } + }, + "dnf_timeout": { + "type": int, + "default": 30, + "desc": "The timeout configuration for dnf operations, in seconds." + }, } def __init__(self, conf_section_obj): diff --git a/module_build_service/scheduler/default_modules.py b/module_build_service/scheduler/default_modules.py index 44ab7cb4..a355f60a 100644 --- a/module_build_service/scheduler/default_modules.py +++ b/module_build_service/scheduler/default_modules.py @@ -366,6 +366,7 @@ def _get_rpms_in_external_repo(repo_url, arches, cache_dir_name): dnf_conf.cachedir = cache_location # Don't skip repos that can't be synchronized dnf_conf.skip_if_unavailable = False + dnf_conf.timeout = conf.dnf_timeout # Get rid of everything to be sure it's a blank slate. This doesn't delete the cached repo data. base.reset(repos=True, goal=True, sack=True)