From bdf0a4398d40e098e4952f1d1ac42b4b36e8b033 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Apr 27 2022 08:57:18 +0000 Subject: frontend: texlive DoS for DistGit again Before, even a single long running non-background DistGit import task (e.g. for the large SRPMs like texlive) caused that all the background import tasks were not processed for a long time. Newly we _always_ let the dist-git importer(s) process a part of the background queue (if any). Note this is not 100% ideal (several long-time running background jobs can delay processing of non-background jobs for some time), so we should eventually migrate the "priority queue" logic (WorkerManager abstraction) which is already on the Backend side. Fortunately most of the import tasks are processed instantly. --- diff --git a/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py b/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py index 21c8bd3..8d5a02f 100644 --- a/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py +++ b/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py @@ -40,8 +40,7 @@ def dist_git_importing_queue(): tasks = [] builds_for_import = BuildsLogic.get_build_importing_queue().filter(models.Build.is_background == false()).limit(100).all() - if not builds_for_import: - builds_for_import = BuildsLogic.get_build_importing_queue().filter(models.Build.is_background == true()).limit(30).all() + builds_for_import += BuildsLogic.get_build_importing_queue().filter(models.Build.is_background == true()).limit(30).all() for build in builds_for_import: branches = set()