From 658d607a35b9030c8b91c0cb453e7f8fd6cf60b6 Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Thu, 16 Jul 2026 17:00:33 +0200 Subject: [PATCH 1/2] fix: use blocking GLib main context iteration to prevent CPU busy-spin GLibEventLoop._iterate_event_loop was calling context.iteration(False), which returns immediately when no events are pending. When process_signals(return_after=...) loops waiting for a signal that takes minutes to arrive (e.g. installation completion in anaconda TUI), this causes a 100% CPU busy-spin. Change the default to blocking iteration (may_block=True) so the GLib context sleeps until a source fires. Add a blocking parameter to the constructor so tests can opt into non-blocking mode. Resolves: rhbz#2344225 --- simpleline/event_loop/glib_event_loop.py | 10 ++++------ tests/units/glib/__init__.py | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/simpleline/event_loop/glib_event_loop.py b/simpleline/event_loop/glib_event_loop.py index 1d98797..5519def 100644 --- a/simpleline/event_loop/glib_event_loop.py +++ b/simpleline/event_loop/glib_event_loop.py @@ -43,8 +43,9 @@ class GLibEventLoop(AbstractEventLoop): - def __init__(self): + def __init__(self, blocking=True): super().__init__() + self._blocking = blocking # Create first loop loop = GLib.MainLoop() self._event_loops = [EventLoopData(loop)] @@ -208,12 +209,9 @@ def process_signals(self, return_after=None): else: self._iterate_event_loop(loop_data.loop) - @staticmethod - def _iterate_event_loop(event_loop): + def _iterate_event_loop(self, event_loop): context = event_loop.get_context() - # This is useful for tests - wait_on_timeout = False - context.iteration(wait_on_timeout) + context.iteration(self._blocking) class EventLoopData(): diff --git a/tests/units/glib/__init__.py b/tests/units/glib/__init__.py index 7574516..21c8257 100644 --- a/tests/units/glib/__init__.py +++ b/tests/units/glib/__init__.py @@ -42,7 +42,7 @@ def _quit_loop(self, loop): def create_glib_loop(self): # clear flags self.timeout_error = False - self.loop = GLibEventLoop() + self.loop = GLibEventLoop(blocking=False) loop = self.loop.active_main_loop context = loop.get_context() From f087751fc791dcf288b26683bd8708522ad9776a Mon Sep 17 00:00:00 2001 From: Katerina Koukiou Date: Thu, 16 Jul 2026 17:34:49 +0200 Subject: [PATCH 2/2] packit: enable pull request copr builds for Rawhide --- .packit.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.packit.yaml b/.packit.yaml index 0ea96e2..fe150d7 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -20,6 +20,7 @@ jobs: - job: copr_build trigger: pull_request targets: + - fedora-rawhide - fedora-eln - job: copr_build