Jump to solution
Details

The Fix

Fixes the issue where the `loop` argument is not passed to `aiodns.DNSResolver` in the 3.11 and 3.12 branches due to a bad cherry-pick merge.

Based on closed aio-libs/aiohttp issue #10787 · 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%.

Open PR/Commit
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@ +Drop explicit loop. Use ``asyncio.get_event_loop()`` instead if the loop instance is needed. +All aiohttp objects work with the currently running loop, a creation of aiohttp instances, e.g. ClientSession when the loop is not running is forbidden. +As a side effect of PR passing callables to ``aiohttp_server()`` and ``aiohttp_client()`` pytest fixtures are forbidden, please call these callables explicitly.
fix.md
Option A — Apply the official fix\nFixes the issue where the `loop` argument is not passed to `aiodns.DNSResolver` in the 3.11 and 3.12 branches due to a bad cherry-pick merge.\nWhen NOT to use: Do not use this fix if the application relies on explicit loop management.\n\n

Why This Fix Works in Production

  • Trigger: AsyncResolver does not use the passed `loop` argument on 3.11 and 3.12 branches due to bad cherry-pick merge
  • Mechanism: Fixes the issue where the `loop` argument is not passed to `aiodns.DNSResolver` in the 3.11 and 3.12 branches due to a bad cherry-pick merge.
Production impact:
  • 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): AsyncResolver does not use the passed `loop` argument on 3.11 and 3.12 branches due to bad cherry-pick merge

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“https://github.com/aio-libs/aiohttp/pull/3580 dropped passing loops explicitly in many places.”
@webknjaz · 2025-04-22 · source
“@webknjaz Yes, but it's still broken in the 3.11/3.12 branches as the loop argument is still there but not passed to aiodns.DNSResolver or used elsewhere…”
@PLPeeters · 2025-04-22 · source
“Thanks for raising this! Could you share a bit more about your use case so we can better understand why this change is needed in…”
@bdraco · 2025-05-22 · source
“Looks like it breaks downstream tests https://github.com/home-assistant/core/actions/runs/15196589891/job/42742754688?pr=145358”
@bdraco · 2025-05-22 · source

Failure Signature (Search String)

  • AsyncResolver does not use the passed `loop` argument on 3.11 and 3.12 branches due to bad cherry-pick merge
  • There seems to be a backport issue in the `3.11` and `3.12` branches. The `loop` argument is not passed to `aiodns.DNSResolver` despite this being the case on the `master` branch,
Copy-friendly signature
signature.txt
Failure Signature ----------------- AsyncResolver does not use the passed `loop` argument on 3.11 and 3.12 branches due to bad cherry-pick merge There seems to be a backport issue in the `3.11` and `3.12` branches. The `loop` argument is not passed to `aiodns.DNSResolver` despite this being the case on the `master` branch, leading to unexpected bugs when it is used.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- AsyncResolver does not use the passed `loop` argument on 3.11 and 3.12 branches due to bad cherry-pick merge There seems to be a backport issue in the `3.11` and `3.12` branches. The `loop` argument is not passed to `aiodns.DNSResolver` despite this being the case on the `master` branch, leading to unexpected bugs when it is used.

What Broke

This leads to unexpected bugs when using the resolver in production environments.

Fix Options (Details)

Option A — Apply the official fix

Fixes the issue where the `loop` argument is not passed to `aiodns.DNSResolver` in the 3.11 and 3.12 branches due to a bad cherry-pick merge.

When NOT to use: Do not use this fix if the application relies on explicit loop management.

Fix reference: https://github.com/aio-libs/aiohttp/pull/3580

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use this fix if the application relies on explicit loop management.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.