-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add download retries to deal better with connection hiccups during build #1574
Conversation
Do you ever see hiccups like this on python 2: kivy/kivy-ios#322? I get it constantly on MacOS, and proposed a more radical fix there: kivy/kivy-ios#332 |
No I'm using Python 3 and this is for legitimate internet hiccups (connection closed/timed out/...) - see also me only catching |
I'm not sure this should sit in p4a code base. It's a transport layer level issue, right? |
@AndreMiras well where else would you put it? Unless urlretrieve accepts retry mechanism patches, I don't see a better place
Whatever the issue is, the impact is very real. I have builds aborting all the time even with my relatively stable home connection, and since a build from scratch takes 20 minutes this has a real productivity impact - and the retry code is relatively simple. IMHO it's worth it |
This very same code (and to some degree, issue) exists in kivy-ios as well. |
@AndreMiras I agree that it belongs somewhere else, but for a different reason. A lot of the code in p4a was blatantly copy-and-pasted to make the original kivy-ios. (e.g. Here's a radical proposal: move this kind of code (Arch, Target, Recipe, download helpers) to somewhere else and retain just the architecture-specific parts in p4a and kivy-ios. My first thought would be put it in buildozer, since that has to interact closely with p4a and kivy anyway |
buildozer uses p4a and not the other way round, e.g. I often use p4a without buildozer installed. So that doesn't make too much sense. It would be nice to unite some of kivy-ios and p4a at some point, but it's really kind of beyond the scope of what I tried to do here 😂 |
@Jonast Yes. Buildozer is a common front-end for invoking p4a and kivy-ios (and other platforms). I'm suggesting that it could just as easily be a common back-end, too. It's that, or move all the shared code to a 3rd library that all 3 draw from. Anyway, as you point out, this is all beyond what this patch attempts to address. I think the patch is good, and I've suggested we do the same over on the kivy-ios side. |
@AndreMiras should I move the download code from I'm pretty open for other options, just let me know where we're heading (and I'm not dying if this isn't included in the near future, but it'd be nice for me to have for sure) |
Well it's approved now. So up to you. Do you have rights to merge it now that's approved? |
@AndreMiras right now I can just approve/disapprove things (and with that kind of block them due my new role), since apparently there is an additional restriction for merging: it says "The base branch restricts merging to authorized users." Which btw is okay with me really, I'm happy to help to actually merge approved things if you want me to, but I don't need to be able to do that. Entirely up to you / the team! |
This adds download retries to deal better with connection hiccups during build. I can't count how many times I got either a minor wifi hiccup, or actually one of the servers just didn't wanna cooperate with a download and the entire build fell apart. This is really annoying to happen, and so while this retry mechanism may not cover all types of downloads in p4a, at least it will add retrying for a good chunk of them!