public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpkg] 1.70-1: Patch: limited thread pool for watching module builds
@ 2026-08-10 21:44 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10 21:44 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : 6b1fa465599d843a1679c9f7764c471e4fbcab34
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2019-12-03T16:22:21+00:00
            Stats  : +48/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/6b1fa465599d843a1679c9f7764c471e4fbcab34?branch=1.70-1

            Log:
            Patch: limited thread pool for watching module builds

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
diff --git a/0007-Use-a-single-thread-pool-while-watching-module-build.patch b/0007-Use-a-single-thread-pool-while-watching-module-build.patch
new file mode 100644
index 0000000..3e51257
--- /dev/null
+++ b/0007-Use-a-single-thread-pool-while-watching-module-build.patch
@@ -0,0 +1,43 @@
+From a99a9a447e809c280bc996b9ed6aba3c4a3a2360 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hunor=20Csomort=C3=A1ni?= <csomh@redhat.com>
+Date: Tue, 3 Dec 2019 12:12:00 +0100
+Subject: [PATCH] Use a single thread pool while watching module builds
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Calling the Pool() constructor on each iteration leaks the threads,
+leading to a "can't start new thread" error during long waits.
+
+This can be aggravated by the constructor being called without an
+argument, which by default uses the systems CPU count to create the
+pool. When running in a container in a cloud environment this number can
+be unexpectedly large (for example, 64).
+
+Reuse the pool and limit the number of threads in the pool.
+
+Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
+---
+ pyrpkg/__init__.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index 67cff94..ab0ad39 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -3826,8 +3826,11 @@ class Commands(object):
+         return stats
+ 
+     def get_watched_module_builds(self, build_ids):
++        # Limit the number of threads to an arbitrary 8,
++        # to avoid starting too many threads when running in a
++        # container in the cloud.
++        pool = ThreadPool(min(8, len(build_ids) or 1))
+         while True:
+-            pool = ThreadPool()
+             module_builds = pool.map(self.module_get_build, build_ids)
+ 
+             for module_build in module_builds:
+-- 
+2.21.0
+

diff --git a/rpkg.spec b/rpkg.spec
index 161c257..8bc3e2c 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
 Name:           rpkg
 Version:        1.59
-Release:        3%{?dist}
+Release:        4%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 License:        GPLv2+ and LGPLv2
@@ -23,6 +23,7 @@ Patch3:         0003-container-build-add-isolated-argument.patch
 Patch4:         0004-tests-add-container-build-isolated-test.patch
 Patch5:         0005-container-build-add-koji-parent-build-argument.patch
 Patch6:         0006-Isolated-container-build-should-allow-arches-overrid.patch
+Patch7:         0007-Use-a-single-thread-pool-while-watching-module-build.patch
 
 %if 0%{?fedora} || 0%{?rhel} > 7
 # Enable python3 build by default
@@ -276,6 +277,9 @@ nosetests tests
 
 
 %changelog
+* Tue Dec 03 2019 Ondřej Nosek <onosek@redhat.com> - 1.59-4
+- Patch: limited thread pool for watching module builds
+
 * Thu Nov 14 2019 Ondřej Nosek <onosek@redhat.com> - 1.59-3
 - Backport: Isolated container-build should allow arches override
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-10 21:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 21:44 [rpms/rpkg] 1.70-1: Patch: limited thread pool for watching module builds 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox