From ff216e1ba9a1ebb90c43b6498b01f9e1d025b870 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Tue, 19 Sep 2017 15:46:33 +0200 Subject: [PATCH] Do not count reused components to concurrent component builds threshold --- module_build_service/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module_build_service/utils.py b/module_build_service/utils.py index 53d43310..34861aff 100644 --- a/module_build_service/utils.py +++ b/module_build_service/utils.py @@ -98,7 +98,12 @@ def at_concurrent_component_threshold(config, session): if config.num_concurrent_builds and config.num_concurrent_builds <= \ session.query(models.ComponentBuild).filter_by( - state=koji.BUILD_STATES['BUILDING']).count(): + state=koji.BUILD_STATES['BUILDING'], + # Components which are reused should not be counted in, because + # we do not submit new build for them. They are in BUILDING state + # just internally in MBS to be handled by + # scheduler.handlers.components.complete. + reused_component_id=None).count(): return True return False