-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Non-parallel GitHub downloads, one progress bar per download #3054
Conversation
In latest commit, we create a 3-second timer to remove completed progress bars and add new ones, so the display won't fill up with full bars, but it also won't be constantly bouncing around. |
Since the timer patch, I get this exception from time to time:
Unfortunately the stack trace doesn't really help locating the cause. But I suspect it's one of the two foreach loops. Maybe I can track it down further. |
1fd5689
to
253d32c
Compare
Added a |
Just wanted to ask if this is intentional or not, but I like it: But I think that's quite nice, because you probably aren't interested in the progress bars of downloads which complete that fast, only for ones that take longer. |
Partially intentional. :) To show all the downloads in the first 3 seconds, we would have to restore the code that displays the progress bars on the fly, and the annoying flickering would be back (even if just for 3 seconds). And the first 3 seconds aren't quite special—if a download both starts and ends in any interval, it won't get a progress bar. |
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.
Error seems to be gone, and otherwise works fine too.
Let's hope that this comforts GitHub a bit.
Problem
If you try to install lots of mods that you haven't previously downloaded, you'll likely get errors like this (possibly in a different format since we've changed them a bunch recently):
Cause
GitHub doesn't like it when you try to download multiple things from it at the same time, which CKAN aggressively does. GitHub sometimes responds to such attempts with 403-Forbidden statuses (the precise rules are not publicly known).
The GitHub API works similarly, except it has defined (and queryable) throttling rules and explicitly says not to download from it in parallel:
Motivation
Since we're planning a pre-release anyway, why not go nuts?
Changes
Now if multiple GitHub downloads are requested, only one of them will be started, and the rest will wait. Non-GitHub downloads will still be performed in parallel as before. When the current GitHub download finishes, one of the others will be started, and so on until completion.
Now each active download has its own progress bar in GUI, so the user can tell what's happening:
Fixes #1817.
Fixes #2210. (URLs haven't been migrated to API format, but that's probably not needed.)
Probably fixes #2400.
Fixes #1085. (The description and conversation went all over the place, so it may not be possible to even define what the issue is about, but the original complaint was about 403 statuses during downloads.)