-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Many improvements for failed downloads #3635
Many improvements for failed downloads #3635
Conversation
Hi @NathanPeake, @epower53, and @Ictiv, there is a test build for these changes under the Artifacts dropdown here: https://github.com/KSP-CKAN/CKAN/pull/3635/checks If you have a chance, please try it out and let us know if you still have problems with downloads. |
This comment was marked as resolved.
This comment was marked as resolved.
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.
Nothing stands out from my read over, should make downloads that barf halfway far less annoying 🎉
This comment was marked as resolved.
This comment was marked as resolved.
Addressed this in latest commit; we now no longer remove mods from the changeset if their broken dependencies are virtual, so the user can go back and make another choice.
The dependencies aren't in the changeset, but the latest commit retrieves the full changeset where needed for the changeset pruning logic. Haven't looked at enforcing relationships in the UI. This feels like something we can do without and return to if there's demand. |
This comment was marked as outdated.
This comment was marked as outdated.
This is what I have been wanting for a long long time. thanks for adding this feature. |
Background
We have had a lot of recent user frustration with how CKAN reacts when downloads fail. Such errors are hard to reproduce with the full app running because they happen randomly according to users' network conditions. However, I recently hit upon a strategy: edit
CKAN/registry.json
and change thedownload
properties of the latest versions of some mods so they're invalid (I added/BROKEN_LINK/
at the start of each URL's path).Note that this will only work for mods with non-redistributable licenses (generallyAlso setrestricted
), because otherwise the downloader will fall back toarchive.org
and succeed. The ones in the screenshot below work well for this, if it saves reviewers the trouble of finding them; you can right click them to purge them from the cache if they're already downloaded.license
torestricted
to suppress thearchive.org
fallback URLs.Problems
The changeset is cleared after an unsuccessful install, which is bad because the user probably still wants to install those mods.
With my mildly corrupted registry in place, I was finally able to conduct a proper investigation with failures-on-demand, and I discovered several more issues, some of which may simply be root causes of mysterious unreproducible issues that were reported previously:
ckan gui --show-console
gets confused and thinks--show-console
is an identifier that you want it to highlight, resulting in a superfluous "Not found" message in the log 🤦queuedDownloads
withFirstOrDefault
: one thread can change the list while the other is searching it, which throws an exceptionthis.modules
and therefore thinks they're in progressnot:cached
filter and then download a mod to cache, it doesn't disappear even though it no longer matches the filterWait
tab is messy and hard to change without breaking something elseChanges
Now if any downloads in your changeset fail, this popup appears over the install progress screen:
Clicking either checkbox in a row will toggle both of that row's checkboxes; rather than representing this with a single checkbox, I wanted to make it clear that both choices are actions, and you are sorting the mods into one group or the other.
If you click "Abort whole changeset", then any uninstallations are rolled back and you are returned to the main mod list with your changeset intact. If you click "Retry", then any mods with a check mark in the "Skip" column will be removed from your changeset, along with any mods depending on them, and CKAN will try again with the mods with check marks in the Retry column plus the ones that didn't fail.
--show-console
isn't passed to GUI since it's handled before thatlock
mutex protects the queued downloads collection, so only one thread can change it at a timethis.modules
after a batch finishes, successfully or otherwise, so it can be used to retry failed downloadsBackgroundWorker
s used for interacting withWait
are replaced by one that lives insideWait
, for better encapsulation. The functions formerly assigned toDoWork
andRunWorkerCompleted
are now parameters toStartWaiting
. In addition, some ofWait
's functions are changed frompublic
toprivate
and only manipulated from well defined, well known interfaces. This will make it easier to keep track of where these things are being used and ensure they don't end up in a weird state.Wait.OnCancel
is now used by other code to react to cancellation instead ofMain.cancelCallback
, and the Cancel button is only available if thecancelable
parameter toStartWaiting
istrue
(which it is for installation and downloading to cache)Wait.RetryEnabled = true
when the failure handler supports itModuleDownloadErrorsKraken
's list of modules and their corresponding download errors is public, so we can use it in the popupInstallMods
now catchesModuleDownloadErrorsKraken
and passes its module/exception info to the new popup, then either throws a cancellation kraken or removes the skipped mods and their depending mods fromtoInstall
ManageMods
ManageMods
immediately since you don't benefit from reading text that says you cancelledRegistry.FindReverseDependencies
now has asatisfiedFilter
parameter that accepts a function fromRelationshipDescriptor
tobool
, which we use to avoid removing a depending mod from the changeset if the broken dependency is virtual; this way, the user can Skip a virtual dependency and then make a different choiceThis should provide a much more stable and pleasant experience when downloads fail.
Fixes #873.
Fixes #1636.
Fixes #3588.
Fixes #3604.