-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset Mutex (Issue 2429) #2460
Reset Mutex (Issue 2429) #2460
Conversation
…ble the crash handler Use version-tagged zips for the downloaded packages
-- Still tests failing and some coverage missing after refactor
…all from zips, not from files
Always add the temp download area to the search patch for downloading wheels. This should work for the MacOS shim where we have to download a signed wheel for pygame and then be sure to use that in preference to the PyPI version
Remove (again) `upgrade_pip` + Tidy
Can't get this to pass all tests -- I assume that the PiOS ones are because the relevant VM is down or something? Unless anyone objects, I'll merge it soon and then let people play with it. I've tested on Linux & Windows so it's only if MacOS has an issue. @carlosperate (or anyone) please take it for a spin on MacOS if you can. The only reasonable test is to make sure the Mutex continues to work in normal circs -- ie you start one session and attempt to start another; but then doesn't prevent the second instance if the first session is killed hard |
@tjguk thank you so much for all your work on this. |
When the app hard crashes (eg via a faulty appimage) while the Mutex is held, there is no way to reset it short of writing code to do that or rebooting! This change adds a small change which will reset the Mutex if it's orphaned but will not have any effect if it's still owned by another process (its primary purpose).
It's not easy to test -- least of all automatically. I've only been able to ad hoc test it on Linux -- and that may well be the only platform on which the problem occurs, as on other platforms the shared memory which the Mutex uses is released by the OS; on Linux it has to be released by the app.
My standard approach is to use the appimage binary which crashes consistently on my Linux Mint setup. That then leaves the Mutex held but orphaned. Without this PR, Mu will never start up; with the PR in place Mu will re-own the shared memory and will acquire the Mutex. Conversely, if the Mutex is in fact held by a running Mu instance, with this PR, things happen as they should and the second instance does not run.