diff --git a/mbs-PR1718-nudge-reused-components.patch b/mbs-PR1718-nudge-reused-components.patch new file mode 100644 index 0000000..e4a54c3 --- /dev/null +++ b/mbs-PR1718-nudge-reused-components.patch @@ -0,0 +1,55 @@ +From a1494e66aa61334ad2bb9b79e8989a94c100b165 Mon Sep 17 00:00:00 2001 +From: Mike McLean +Date: Jul 07 2021 22:22:24 +0000 +Subject: also nudge reused components after 10 minutes + + +--- + +diff --git a/module_build_service/scheduler/producer.py b/module_build_service/scheduler/producer.py +index bdf1ae0..b6f08f4 100644 +--- a/module_build_service/scheduler/producer.py ++++ b/module_build_service/scheduler/producer.py +@@ -105,6 +105,7 @@ def fail_lost_builds(): + # TODO re-use + + if conf.system == "koji": ++ ten_minutes = timedelta(minutes=10) + # We don't do this on behalf of users + koji_session = get_session(conf, login=False) + log.info("Querying tasks for statuses:") +@@ -119,15 +120,17 @@ def fail_lost_builds(): + if not component_build.task_id: + continue + +- # Don't check tasks for components which have been reused, +- # they may have BUILDING state temporarily before we tag them +- # to new module tag. Checking them would be waste of resources. ++ # For components which have been reused, wait 10 minutes before checking. ++ # They may be in BUILDING state temporarily before we tag them ++ # to new module tag. Checking them at that point would be waste of resources. + if component_build.reused_component_id: +- log.debug( +- 'Skipping check for task "%s", the component has been reused ("%s").', +- component_build.task_id, component_build.reused_component_id +- ) +- continue ++ now = datetime.utcnow() ++ if (now - component_build.module_build.time_modified) < ten_minutes: ++ log.debug( ++ 'Skipping check for task "%s", the component has been reused ("%s").', ++ component_build.task_id, component_build.reused_component_id ++ ) ++ continue + + task_id = component_build.task_id + +@@ -165,6 +168,7 @@ def fail_lost_builds(): + build_name=component_build.package, + build_release=build_release, + build_version=build_version, ++ module_build_id=component_build.module_build.id, + ) + + elif conf.system == "mock": + diff --git a/module-build-service.spec b/module-build-service.spec index b6cd084..0b8e131 100644 --- a/module-build-service.spec +++ b/module-build-service.spec @@ -1,6 +1,6 @@ Name: module-build-service Version: 3.6.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: The Module Build Service for Modularity License: MIT @@ -8,7 +8,8 @@ URL: https://pagure.io/fm-orchestrator Source0: https://files.pythonhosted.org/packages/source/m/%{name}/%{name}-%{version}.tar.gz Patch0: mbs-PR1709-fix-scratch-build-suffix.patch Patch1: mbs-PR1711-enforce-sane-module-state-transitions.patch -Patch2: mbs-PR1729-dont-filter-runtime-deps.patch +Patch2: mbs-PR1718-nudge-reused-components.patch +Patch3: mbs-PR1729-dont-filter-runtime-deps.patch BuildArch: noarch ExclusiveArch: %{ix86} x86_64 noarch @@ -70,6 +71,7 @@ for a number of tasks: %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Workaround because python2-koji has no egg-info file at the momement sed -i '/koji/d' requirements.txt @@ -101,6 +103,9 @@ sed -i '/koji/d' requirements.txt %changelog +* Fri Jun 24 2022 Brendan Reilly - 3.6.1-5 +- Add patch to nudge reused components + * Wed Nov 17 2021 Brendan Reilly - 3.6.1-3 - Add patch to fix scratch build suffix bug