public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Patch: limited thread pool for watching module builds
Date: Mon, 10 Aug 2026 21:44:10 GMT [thread overview]
Message-ID: <178639825039.1.13046019034724206403.rpms-rpkg-6b1fa465599d@fedoraproject.org> (raw)
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
reply other threads:[~2026-08-10 21:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178639825039.1.13046019034724206403.rpms-rpkg-6b1fa465599d@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox