Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [
"tokenizers>=0.21.0,<1.0",
"click>=8.0.0,<9.0",
"jinja2>=3.1.6,<4.0",
"aiohttp>=3.10,<4.0",
"aiohttp>=3.14.2,<4.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Conflicting aiohttp workflow requirements

When the scheduled price and context-window update runs with --with 'aiohttp==3.13.3', the new aiohttp>=3.14.2 project floor makes the requirements unsatisfiable, causing dependency resolution to fail before the update script runs.

"pydantic>=2.10.0,<3.0.0",
"jsonschema>=4.0.0,<5.0",
]
Expand Down Expand Up @@ -277,7 +277,7 @@ exclude = [
[tool.uv]
constraint-dependencies = [
"tornado>=6.5.6",
"aiohttp>=3.14.1,<4.0",
"aiohttp>=3.14.2,<4.0",
"packaging>=24.0",
"soupsieve>=2.8.4",
"httplib2>=0.32.0",
Expand Down
71 changes: 71 additions & 0 deletions tests/local_testing/test_basic_python_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,77 @@ def test_cli_extra_is_a_thin_client_install():
assert not leaked, f"`cli` extra leaks proxy-server deps onto laptops: {leaked}"


AIOHTTP_POOL_POISONING_RANGE = ">=3.14.0,<3.14.2"
AIOHTTP_POOL_POISONING_RELEASES = ("3.14.0", "3.14.1")


def _load_toml(path):
try:
import tomllib as tomli
except ImportError:
try:
import tomli
except ImportError:
pytest.skip("tomli/tomllib not available - skipping dependency check")

with open(path, "rb") as f:
return tomli.load(f)


def _declared_aiohttp_specifier():
from packaging.requirements import Requirement

pyproject = _load_toml(os.path.join(PROJECT_ROOT, "pyproject.toml"))
for requirement in pyproject["project"]["dependencies"]:
parsed = Requirement(requirement)
if parsed.name.lower() == "aiohttp":
return parsed.specifier
pytest.fail("aiohttp is no longer a declared runtime dependency of litellm")


def _locked_aiohttp_version():
lock = _load_toml(os.path.join(PROJECT_ROOT, "uv.lock"))
for package in lock["package"]:
if package["name"].lower() == "aiohttp":
return package["version"]
pytest.fail("aiohttp is missing from uv.lock")


def test_declared_aiohttp_floor_excludes_pool_poisoning_releases():
"""aiohttp 3.14.0/3.14.1 re-arm the sock_read timer on a keep-alive connection
after it is back in the idle pool, so the next request to reuse it fails
instantly with a bogus timeout (aio-libs/aiohttp#12953, fixed in 3.14.2).

The wheel's own metadata is what pip resolves against, so the floor declared
here - not just the lockfile - has to exclude that range.
"""
specifier = _declared_aiohttp_specifier()

admitted = [v for v in AIOHTTP_POOL_POISONING_RELEASES if specifier.contains(v)]
assert not admitted, (
f"litellm declares aiohttp{specifier}, which still admits {admitted}. "
"Those releases poison pooled keep-alive connections and cause "
"cross-provider sub-millisecond 'Connection timed out' failures; "
"keep the floor at >=3.14.2."
)


def test_locked_aiohttp_version_is_not_pool_poisoning():
"""uv.lock is what the published Docker images install (uv sync --frozen), so a
lock that drifts back onto 3.14.0/3.14.1 ships the regression regardless of
what pyproject.toml declares.
"""
from packaging.specifiers import SpecifierSet

locked = _locked_aiohttp_version()

assert not SpecifierSet(AIOHTTP_POOL_POISONING_RANGE).contains(locked), (
f"uv.lock resolves aiohttp {locked}, which is inside the pool-poisoning "
f"range {AIOHTTP_POOL_POISONING_RANGE} (aio-libs/aiohttp#12953). "
"Re-run `uv lock` against an aiohttp>=3.14.2 floor."
)


import os
import subprocess
import time
Expand Down
Loading
Loading