-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Report AutoUpdater errors to user, fix rare failure #3250
Conversation
1d798d9
to
27e2b02
Compare
7080374
to
dbec03e
Compare
Hm, Mono seems to not actually wait with Here it sounds like this is expected on Unix/Linux: https://xamarin.github.io/bugzilla-archives/18/18328/bug.html
Given the nature of Unix file locking this isn't really problematic, the file still gets switched out successfully. Only thing that could happen is that the new instance could already start while the other one isn't closed yet. I think it's worth adding this as a code comment somewhere, so future devs don't have to reinvestigate it when they encounter the same. |
Another thing, the |
Hmm, I wonder if we could do something with pipes. Since "we" are the child of the process we want to watch, it could redirect our stdin, and then we could wait for stdin to be closed... The |
Interesting idea, that could work.
But File → Quit doesn't do it in a background worker, does it? I think that's where the problem comes from. |
The docs are evasive on this point, but I think that we are calling
CKAN/GUI/Main/MainAutoUpdate.cs Line 65 in dbec03e
|
I think There's also some trouble with attempting to load the mod list while the auto-update is in progress... |
dbec03e
to
656548b
Compare
OK, summary of latest changes:
After this the full update flow works for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redirecting stdin does indeed seem to to the trick, cool idea!
And it does now also properly close the window 🎉
Thanks!
Problems
Cause
Core
callsExit(0)
which exits immediately, and in GUI this is done from a background task, interrupting anything else that might be going on, including saving the registryChanges
launch
, only passed by GUI and not byckan upgrade ckan
), then any errors are also reported in a popup window, so average GUI users will be able to see it:AutoUpdate.StartUpdateProcess
no longer exits, and instead the calling code from each UI is expected to exit safely according to its own practices, which GUI now does viaClose()
GUI/Main/MainAutoUpdate.cs
so we don't have to go hunting for itSince we identiifed and fixed a way it could have happened, I think we can say this fixes #3245, but if it doesn't, at least we'll be able to gather enough info to figure out the true fix next time.