Title: fix(net): resume downloads after a mid-stream connection drop by jnuyens · Pull Request #182 · MicroPythonOS/MicroPythonOS · GitHub
Open Graph Title: fix(net): resume downloads after a mid-stream connection drop by jnuyens · Pull Request #182 · MicroPythonOS/MicroPythonOS
X Title: fix(net): resume downloads after a mid-stream connection drop by jnuyens · Pull Request #182 · MicroPythonOS/MicroPythonOS
Description: Follow-up from the networking shortlist (the download_manager.py:285 item).
Problem
The per-chunk retry loop re-read the same aiohttp reader after a failure.
Once the underlying TCP/TLS connection dropped — common on flaky badge WiFi —
that reader was dead, so all 3 retries failed and the entire download aborted
with OSError(-110). The resume infrastructure (Range/Content-Range,
get_resume_position) already existed but was never used on retry, so a blip
near the end of a large album/.mpk download threw away all progress.
Fix
Restructure the read path into a connection-retry loop:
On a read error, close the connection and re-issue the request with
Range: bytes=
Open Graph Description: Follow-up from the networking shortlist (the download_manager.py:285 item). Problem The per-chunk retry loop re-read the same aiohttp reader after a failure. Once the underlying TCP/TLS connection ...
X Description: Follow-up from the networking shortlist (the download_manager.py:285 item). Problem The per-chunk retry loop re-read the same aiohttp reader after a failure. Once the underlying TCP/TLS connection ...
Opengraph URL: https://github.com/MicroPythonOS/MicroPythonOS/pull/182
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:612f0071-8661-2491-ec52-45cccafd8f2c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E76A:1AAD29:31A3EB:4325C3:6A514198 |
| html-safe-nonce | 15cf8171834d8ac75374ff56fbdc5ee272c9d7ebd5567d6d201f2372b8278a7b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzZBOjFBQUQyOTozMUEzRUI6NDMyNUMzOjZBNTE0MTk4IiwidmlzaXRvcl9pZCI6Ijg0NzU1MjQ2Nzk0MjcyNDQ0NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ce99f7ef774b0da0eaa9b75e2f703cb4ad6035c3d2a4a57f4039f771a6ea2d12 |
| hovercard-subject-tag | pull_request:3958894639 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/MicroPythonOS/MicroPythonOS/pull/182/files |
| twitter:image | https://avatars.githubusercontent.com/u/3696148?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3696148?s=400&v=4 |
| og:image:alt | Follow-up from the networking shortlist (the download_manager.py:285 item). Problem The per-chunk retry loop re-read the same aiohttp reader after a failure. Once the underlying TCP/TLS connection ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e840f405b2718e8f2d55aafa9ff27dbce17e29d0c253011d05ea0fea3c78baff |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/MicroPythonOS/MicroPythonOS git https://github.com/MicroPythonOS/MicroPythonOS.git |
| octolytics-dimension-user_id | 213598128 |
| octolytics-dimension-user_login | MicroPythonOS |
| octolytics-dimension-repository_id | 975472483 |
| octolytics-dimension-repository_nwo | MicroPythonOS/MicroPythonOS |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 975472483 |
| octolytics-dimension-repository_network_root_nwo | MicroPythonOS/MicroPythonOS |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e876f00c5723f6080b9d294e4958fd4d506e6faf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width