Skip to content

fix: loader freeze on manual plugin install/update - #977

Open
mubaraknumann wants to merge 1 commit into
SteamDeckHomebrew:mainfrom
mubaraknumann:fix/plugin-install-freeze
Open

mubaraknumann wants to merge 1 commit into
SteamDeckHomebrew:mainfrom
mubaraknumann:fix/plugin-install-freeze

Conversation

@mubaraknumann

Copy link
Copy Markdown

Please tick as appropriate:

  • I have tested this code on a steam deck or on a PC
  • My changes generate no new errors/warnings
  • This is a bugfix/hotfix
  • This is a new feature

If you're wanting to update a translation or add a new one, please use the weblate page: https://weblate.werwolv.net/projects/decky/

Description

This fixes issue: N/A

I've been chasing an issue where, when I manually install my plugin via zip or URL, my plugin gets stuck on "Downloading any external binaries" or "Installing plugin". After that Decky stops responding, the settings page just stays dark, and restarting plugin_loader doesn't bring it back because the stuck loader process survives Steam restart and I need to do a system restart.

Fixes:

Changed _read_single_line() to return None when a plugin's socket closes, and added a check in _response_listener() to stop listening once the plugin process has exited. Fixes the loader stuck looping on a dead connection.

Added fork hooks in plugin.py that hold the logging locks while a plugin process is forked and reset its signal handlers. Avoids newly started plugin from hanging on its first log line or pass a stop signal back to the loader.

Changed _install() to look up the installed plugin by the name in plugin.json. ZIP should get installed after running copy is first uninstalled cleanly instead of unpacking over it.

Testing

Tested on a Steam Deck on Prerelease with a dev build. I did 15 updates and zip installs in a row over a running plugin and none of them hung or left a broken install. Before the fix the same Deck hung twice in about ten tries.

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