twine
twine copied to clipboard
upload: add connection exceptions to upload retry protocol
Addresses our intermittent upload issues as described that #1017 was initially trying to address.
Although we are mainly running into "connection reset by peer" exceptions, I've added connection timeouts, and I'd consider adding a sleep between retries.
Sorry, meant to draft this from the start, PR was meant as a rough proposal and there a few things that are still unclear:
- ~~the original code returns None on error codes (type return mismatch).~~
- we have been getting Connection errors, but retrying timeouts "might" be a good idea. (yes/no)?
- should we add a sleep to the retries?
will add a test and a few improvements asap.
This doesn't merge cleanly, doesn't solve the problem at the right layer, and it re-invents a wheel for which there are many good solutions. I'm closing this.