The Fix
Fixes blocking I/O in the event loop when netrc authentication is used by moving netrc file lookup to an executor.
Based on closed aio-libs/aiohttp issue #10435 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+Fixed blocking I/O in the event loop when using netrc authentication by moving netrc file lookup to an executor -- by :user:`bdraco`.
diff --git a/aiohttp/client.py b/aiohttp/client.py
index a7da3ff0c57..7a4ad715362 100644
Option A — Apply the official fix\nFixes blocking I/O in the event loop when netrc authentication is used by moving netrc file lookup to an executor.\nWhen NOT to use: This fix should not be used if synchronous netrc file access is required.\n\n
Why This Fix Works in Production
- Trigger: ```python-traceback
- Mechanism: Fixes blocking I/O in the event loop when netrc authentication is used by moving netrc file lookup to an executor.
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Production symptom (often without a traceback): ```python-traceback
Proof / Evidence
- GitHub issue: #10435
- Fix PR: https://github.com/aio-libs/aiohttp/pull/11634
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.70
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.70
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Caching the result of netrc_from_env (eg with @functools.cache) could be a first step to minimize the impact”
“We can potentially put a proper fix into v4 and mitigations into v3, if necessary.”
“How long is the call blocks? Do you have numbers? I expect that the filesystem cache works pretty well in this case.”
“I don't have numbers for how long it blocks”
Failure Signature (Search String)
- ```python-traceback
- I understand the tradeoff between making a breaking change and doing a small optimization.
Copy-friendly signature
Failure Signature
-----------------
```python-traceback
I understand the tradeoff between making a breaking change and doing a small optimization.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
```python-traceback
I understand the tradeoff between making a breaking change and doing a small optimization.
What Broke
Instantiating ClientRequest blocks the asyncio event loop, causing delays in request handling.
Fix Options (Details)
Option A — Apply the official fix
Fixes blocking I/O in the event loop when netrc authentication is used by moving netrc file lookup to an executor.
Fix reference: https://github.com/aio-libs/aiohttp/pull/11634
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if synchronous netrc file access is required.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a stress test that runs high-concurrency workloads and fails on thread dumps / blocked locks.
- Enable watchdog dumps in prod (faulthandler, thread dump endpoint) to capture deadlocks quickly.
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.