Skip to content
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

Retry failed web requests, fix install stanza error #3166

Merged
merged 1 commit into from Oct 4, 2020

Conversation

HebaruSan
Copy link
Member

Problems

  • Since Multi-find fixes #3074, a mod with a bad install stanza says, "Sequence contains no elements" instead of explaining that the stanza didn't match any files
  • Even if the previous point is fixed, a mod using the default install stanza will throw a null reference error if it doesn't match any files
  • Warnings about fetching remote version files don't print the remote URL (which would have been convenient for the following point)
  • Prior to the recent flood of SpaceDock "The request was canceled" spam, after Purge CurlSharp #3118, the netkan-bot channel was plagued with these errors:
    image
    This is mostly harmless, unless a mod author is actually using the remote version file to update compatibility after release, in which case it can cause CKAN's metadata to temporarily revert to the at-release state.

Causes

  • The code to find shortestMatch threw an exception if there were no matches, when it should have defaulted to null
  • CkanModule.DescribeInstallStanzas assumed install would not be null
  • ksp-avc.cybutek.net and ksp.spacetux.net are flaky servers, probably because they're run by individuals rather than big companies with cloud resources. They seem to fail in about 0.1% of requests; prior to Purge CurlSharp #3118, we fell back to CurlSharp in these cases, but after that PR the fallback is removed.

Changes

  • Now errors like Module contains no files matching: find="Cosmogator" are back
  • Now CkanModule.DescribeInstallStanzas knows how default install stanzas work
  • Now remote version file fetch errors print the URL
  • Now if a URL fails for non-protocol reasons (i.e., if it's a network failure rather than a HTTP 404), we try again immediately, then after waiting 0.1s, then 0.2s, then 0.3s. If it still doesn't work, we finally give up and fail as before.

@HebaruSan HebaruSan added Bug Core (ckan.dll) Issues affecting the core part of CKAN Pull request Netkan Issues affecting the netkan data Network Issues affecting internet connections of CKAN labels Oct 3, 2020
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! Can't wait for the bot to stop spamming all the download errors.

@HebaruSan HebaruSan merged commit 07e44f1 into KSP-CKAN:master Oct 4, 2020
@HebaruSan HebaruSan deleted the fix/web-retry branch October 4, 2020 19:26
@HebaruSan
Copy link
Member Author

Yeah, I may un-mute the netkan-bot channel soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Core (ckan.dll) Issues affecting the core part of CKAN Netkan Issues affecting the netkan data Network Issues affecting internet connections of CKAN Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants