Title: fix(net): aiohttp header-read timeout + mutable-header poisoning + atomic wifi_busy by jnuyens · Pull Request #179 · MicroPythonOS/MicroPythonOS · GitHub
Open Graph Title: fix(net): aiohttp header-read timeout + mutable-header poisoning + atomic wifi_busy by jnuyens · Pull Request #179 · MicroPythonOS/MicroPythonOS
X Title: fix(net): aiohttp header-read timeout + mutable-header poisoning + atomic wifi_busy by jnuyens · Pull Request #179 · MicroPythonOS/MicroPythonOS
Description: A small batch of networking robustness fixes (maintainer shortlist). 1. aiohttp: stalled server can hang the loop/UI forever _request's timeout covered only DNS+connect; the status-line and response-header readline() reads were unbounded. A server that accepts the connection then stalls before/while sending headers froze the asyncio event loop (and the LVGL UI) forever. The header read is now wrapped in the same wait_for(timeout). Body reads remain the caller's responsibility (DownloadManager already bounds per-chunk reads). 2. aiohttp: mutable-default headers={} poisoning The four headers={} default parameters are now headers=None, and request_raw copies the dict before mutating it (Host/Content-Type/Content-Length) — so a caller-shared headers dict can no longer be poisoned across requests. 3. WifiService: wifi_busy check-then-set race auto_connect() and temporarily_disable() each tested wifi_busy then set it in separate statements. Two threads (boot auto-connect + the WiFi app) could both see wifi_busy=False and proceed → double-connect. Added a _busy_lock + _acquire_busy() helper that does the check-and-set atomically, used at both sites. Testing (macOS sim) New stall test: with a server that connects but never sends headers, _request(timeout=1) now raises TimeoutError at ~1.0s instead of hanging (verified old path would hang). Header isolation: two ClientSessions with different default headers stay isolated. Existing suites: test_websocket OK, test_async_dns OK, test_wifi_service 46/46 OK. mpy-cross compiles both files on this branch's base; ASCII-only. Independent of #177 (touches different regions of aiohttp/__init__.py).
Open Graph Description: A small batch of networking robustness fixes (maintainer shortlist). 1. aiohttp: stalled server can hang the loop/UI forever _request's timeout covered only DNS+connect; the status-line and res...
X Description: A small batch of networking robustness fixes (maintainer shortlist). 1. aiohttp: stalled server can hang the loop/UI forever _request's timeout covered only DNS+connect; the status-line and...
Opengraph URL: https://github.com/MicroPythonOS/MicroPythonOS/pull/179
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:aa967e5a-62c1-9429-e1d1-a72d0f698e26 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DC90:1F19:86C17A4:BF438F7:6A510F21 |
| html-safe-nonce | 87f72caacfb9f1a5d15088d46adcd02b816866e8d9e7d652d23dbfa5e0621de7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzkwOjFGMTk6ODZDMTdBNDpCRjQzOEY3OjZBNTEwRjIxIiwidmlzaXRvcl9pZCI6IjU4NTg2MjEwMjQ5MDYxNTU4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 319ab37e8e118506deb838991078c5710d68cc2aca4cc04a5e745c3158537dad |
| hovercard-subject-tag | pull_request:3951834518 |
| 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/179/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 | A small batch of networking robustness fixes (maintainer shortlist). 1. aiohttp: stalled server can hang the loop/UI forever _request's timeout covered only DNS+connect; the status-line and res... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b076e100febaa00374cd89239f915d00dd3187f7c68b12bc2b7688181305344d |
| 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 | f9137f6d981cbbfd780af369f80ce890b2d0d2d4 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width