Skip to content

flatpak-update-worker.py: Quit when mintupdate closes the pipe - #1118

Open
dualfroz wants to merge 1 commit into
linuxmint:masterfrom
dualfroz:fix/1041-flatpak-worker-eof
Open

dualfroz wants to merge 1 commit into
linuxmint:masterfrom
dualfroz:fix/1041-flatpak-worker-eof

Conversation

@dualfroz

Copy link
Copy Markdown

once mintupdate exits or closes stdin, message_from_updater gets an empty GLib.Bytes, which is still truthy in python, so it just queued another read and the worker spun on EOF forever. it now checks get_size() == 0 and quits, same as what the SIGTERM from terminate_helper does. added a test for it in tests/, closes #1041

An empty GLib.Bytes is truthy, so the 'if bytes_read' check never
caught EOF on stdin and the read was queued again right away. When
mintupdate went away the worker kept spinning on zero-byte reads at
high CPU. Quit on a zero-sized read instead of reading again.
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.

flatpak-update-worker busy-loops at ~46% CPU when parent mintUpdate process exits

1 participant