Skip to content

fix: use blocking GLib main context iteration to prevent CPU busy-spin#133

Open
KKoukiou wants to merge 2 commits into
mainfrom
rhbz#2344225
Open

fix: use blocking GLib main context iteration to prevent CPU busy-spin#133
KKoukiou wants to merge 2 commits into
mainfrom
rhbz#2344225

Conversation

@KKoukiou

@KKoukiou KKoukiou commented Jul 16, 2026

Copy link
Copy Markdown

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

I was able to reproduce the linked bug:

Before:
Screenshot 2026-07-20 at 09-09-31 Virtual machines - kkoukiou@fedora

With fix:
Screenshot 2026-07-20 at 09-04-22 Virtual machines - kkoukiou@fedora

KKoukiou added 2 commits July 16, 2026 17:02
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
@KKoukiou
KKoukiou marked this pull request as ready for review July 20, 2026 07:11
@KKoukiou
KKoukiou requested a review from bruno-fs July 20, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant