ArchipelagoMW / Archipelago

Archipelago Multi-Game Randomizer and Server
https://archipelago.gg
Other
426 stars 561 forks source link

Bug: CommonClient GUI freezes when running from source #1189

Open recklesscoder opened 1 year ago

recklesscoder commented 1 year ago

The Issue

I'm having a weird issue where, when running a CommonClient-based client from source, the GUI "sometimes" freezes completely and permanently(*). In this state debuggers cannot pause the execution (I've tried PyCharm and Visual Studio) and all that is left to do is to kill the process.

I believe to have run into this freeze in multiple different ways, but I have so far only managed to find one sequence of steps that reliably reproduces the issue on my machine. Confoundingly, these steps do not cause the issue if I run the exact same source from the executable created using setup.py build.

Impact

As this seems to only concern running from source, and it possibly only affects Windows, the amount of end-users experiencing this issue is likely miniscule. To me the main impact is that a) it erodes the trust that code behaves the same when run from source as when bundled for end-users, and b) it makes development and testing of changes and features in whose vicinity the freezes happen more cumbersome (for example, #1190).

Steps to Reproduce

  1. Be on main branch or 0.3.5 or even 0.3.4, with a valid Factorio server build with a valid AP mod set up (in ./factorio or wherever your host.yaml points).
  2. Start FactorioClient (in GUI mode).
  3. Wait for the Factorio server startup to complete ("Established bridge to Factorio Server. Ready to connect to Archipelago via /connect" should appear in the last few messages).
  4. Enter "/factorio /quit" in the command box.
  5. a) Either watch as the GUI freezes permanently during server shutdown (sometimes before, sometimes after saving) [if you ran directly from source], b) Or watch as the server shutdown completes ("Goodbye" as last message) and the GUI stays responsive [if you ran the executable].

Environment

Bonus Oddities

(*) If the PyCharm debugger attempts to stop (not pause) the execution during the freeze, the freeze is fixed somewhat and one can inspect the leftover state of the process. However, I didn't find anything useful there.

recklesscoder commented 1 year ago

I would love for anyone to confirm that they can reproduce this, so I know I'm not crazy / it's not just somehow my machine.

Berserker66 commented 1 year ago

yep, can confirm.