Coder Social home page Coder Social logo

Comments (6)

zanieb avatar zanieb commented on September 21, 2024 1

And here's a bug fix Pylons/waitress#428

from devpi.

zanieb avatar zanieb commented on September 21, 2024

Similarly I cannot reproduce this with an httpx client:

import httpx
import anyio


TARGETS = [
    "http://localhost:3141/packages/pypi/%2Bf/11c/8f37bcca40db9/platformdirs-4.1.0-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/ae7/4fb96c20a0277/click-8.1.7-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/f83/76fb07dd1e86a/aiosignal-1.3.1-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/1f2/8b4522cdc2fb4/attrs-23.1.0-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/8c4/91190033a9af7/packaging-23.2-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/fde/5bd59ab5357e3/frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/c05/567e9c24a6b9f/idna-3.6-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/a0d/503e138a4c123/pathspec-0.12.1-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/d8a/1c6c0be645c74/yarl-1.9.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/439/2f6c0eb8a5668/mypy_extensions-1.0.0-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/ff9/59bee35038c46/multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/8ce/f8710fb849d97/aiohttp-3.9.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/c05/567e9c24a6b9f/idna-3.6-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/fde/5bd59ab5357e3/frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/1f2/8b4522cdc2fb4/attrs-23.1.0-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/ff9/59bee35038c46/multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/ff9/59bee35038c46/multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/d8a/1c6c0be645c74/yarl-1.9.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/fde/5bd59ab5357e3/frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/packages/pypi/%2Bf/f83/76fb07dd1e86a/aiosignal-1.3.1-py3-none-any.whl",
    "http://localhost:3141/packages/pypi/%2Bf/c05/567e9c24a6b9f/idna-3.6-py3-none-any.whl",
]


async def get(client: httpx.AsyncClient, url: str):
    response = await client.get(url)
    if response.status_code != 200:
        print("Failed!")
    return response


async def main():
    async with httpx.AsyncClient(timeout=httpx.Timeout(timeout=300)) as client:
        async with anyio.create_task_group() as tg:
            for _ in range(1000):
                for url in TARGETS:
                    tg.start_soon(get, client, url)


anyio.run(main)

from devpi.

zanieb avatar zanieb commented on September 21, 2024

Here are some debug logs from the Rust hyper client:

Failure with devpi index
0.054234s DEBUG hyper::client::connect::dns resolving host="localhost"
0.055296s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.055535s DEBUG hyper::client::connect::http connected to [::1]:3141
0.057917s DEBUG hyper::proto::h1::io flushed 199 bytes
0.703051s DEBUG hyper::proto::h1::io parsed 12 headers
0.703099s DEBUG hyper::proto::h1::conn incoming body is chunked encoding
0.703191s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
0.715084s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
0.715858s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10FC (4348 bytes)
0.715987s DEBUG hyper::proto::h1::conn incoming body completed
0.742003s DEBUG hyper::client::connect::dns resolving host="localhost"
0.742489s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.742811s DEBUG hyper::client::connect::http connected to [::1]:3141
0.743013s DEBUG hyper::proto::h1::io flushed 183 bytes
0.746810s DEBUG hyper::proto::h1::io parsed 11 headers
0.746830s DEBUG hyper::proto::h1::conn incoming body is empty
0.746964s DEBUG hyper::client::pool pooling idle connection for ("http", localhost:3141)
0.747419s DEBUG hyper::client::connect::dns resolving host="localhost"
0.747889s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.748141s DEBUG hyper::client::connect::http connected to [::1]:3141
0.748307s DEBUG hyper::proto::h1::io flushed 182 bytes
0.750208s DEBUG hyper::proto::h1::io parsed 11 headers
0.750218s DEBUG hyper::proto::h1::conn incoming body is content-length (1388317 bytes)
0.753586s DEBUG hyper::proto::h1::conn incoming body completed
0.753664s DEBUG hyper::client::pool pooling idle connection for ("http", localhost:3141)
0.764335s DEBUG hyper::client::pool reuse idle connection for ("http", localhost:3141)
0.764449s DEBUG hyper::proto::h1::io flushed 199 bytes
0.764730s DEBUG hyper::client::connect::dns resolving host="localhost"
0.765484s DEBUG hyper::client::connect::dns resolving host="localhost"
0.768721s DEBUG hyper::client::connect::dns resolving host="localhost"
0.770746s DEBUG hyper::client::connect::dns resolving host="localhost"
0.821382s DEBUG hyper::client::connect::dns resolving host="localhost"
0.821429s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.821578s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.821628s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.821666s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.821740s DEBUG hyper::client::connect::http connected to [::1]:3141
0.821804s DEBUG hyper::client::connect::http connected to [::1]:3141
0.821858s DEBUG hyper::client::connect::http connected to [::1]:3141
0.821894s DEBUG hyper::client::connect::http connected to [::1]:3141
0.822026s DEBUG hyper::client::connect::http connecting to [::1]:3141
0.822050s DEBUG hyper::proto::h1::io flushed 209 bytes
0.822081s DEBUG hyper::proto::h1::io flushed 203 bytes
0.822089s DEBUG hyper::proto::h1::io flushed 206 bytes
0.822103s DEBUG hyper::proto::h1::io flushed 202 bytes
0.822207s DEBUG hyper::client::connect::http connected to [::1]:3141
0.822316s DEBUG hyper::proto::h1::io flushed 201 bytes
1.365607s DEBUG hyper::proto::h1::io parsed 12 headers
1.365645s DEBUG hyper::proto::h1::conn incoming body is chunked encoding
1.365779s DEBUG hyper::proto::h1::decode incoming chunked header: 0x728C (29324 bytes)
1.366299s DEBUG hyper::proto::h1::conn incoming body completed
1.376691s DEBUG hyper::client::connect::dns resolving host="localhost"
1.377318s DEBUG hyper::client::connect::http connecting to [::1]:3141
1.377615s DEBUG hyper::client::connect::http connected to [::1]:3141
1.377889s DEBUG hyper::proto::h1::io flushed 164 bytes
1.380972s DEBUG hyper::proto::h1::io parsed 11 headers
1.380995s DEBUG hyper::proto::h1::conn incoming body is empty
1.381095s DEBUG hyper::client::pool pooling idle connection for ("http", localhost:3141)
1.381535s DEBUG hyper::client::connect::dns resolving host="localhost"
1.382052s DEBUG hyper::client::connect::http connecting to [::1]:3141
1.382301s DEBUG hyper::client::connect::http connected to [::1]:3141
1.382477s DEBUG hyper::proto::h1::io flushed 163 bytes
1.384350s DEBUG hyper::proto::h1::io parsed 11 headers
1.384362s DEBUG hyper::proto::h1::conn incoming body is content-length (97941 bytes)
1.384672s DEBUG hyper::proto::h1::conn incoming body completed
1.384715s DEBUG hyper::client::pool pooling idle connection for ("http", localhost:3141)
1.464962s DEBUG hyper::proto::h1::io parsed 12 headers
1.465010s DEBUG hyper::proto::h1::conn incoming body is chunked encoding
1.468607s DEBUG hyper::proto::h1::io parsed 12 headers
1.468622s DEBUG hyper::proto::h1::conn incoming body is chunked encoding
1.468647s DEBUG hyper::proto::h1::decode incoming chunked header: 0x5E04 (24068 bytes)
1.468694s DEBUG hyper::proto::h1::decode incoming chunked header: 0x3362 (13154 bytes)
1.469181s DEBUG hyper::proto::h1::conn incoming body completed
1.469193s DEBUG hyper::proto::h1::conn incoming body completed
1.506208s DEBUG hyper::proto::h1::io parsed 12 headers
1.506234s DEBUG hyper::proto::h1::conn incoming body is chunked encoding
1.506809s DEBUG hyper::proto::h1::io parsed 12 headers
1.506820s DEBUG hyper::proto::h1::conn incoming body is chunked encoding
1.506895s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.512603s DEBUG hyper::proto::h1::decode incoming chunked header: 0xFDD (4061 bytes)
1.514926s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.517613s DEBUG hyper::proto::h1::conn incoming body completed
1.519162s DEBUG hyper::client::pool reuse idle connection for ("http", localhost:3141)
1.519267s DEBUG hyper::proto::h1::io flushed 174 bytes
1.521996s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.529456s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.535352s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.541759s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.547111s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.550716s DEBUG hyper::proto::h1::io parsed 12 headers
1.550723s DEBUG hyper::proto::h1::conn incoming body is chunked encoding
1.550742s DEBUG hyper::proto::h1::decode incoming chunked header: 0x68E5 (26853 bytes)
1.551188s DEBUG hyper::proto::h1::conn incoming body completed
1.554617s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.559992s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.564884s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.569645s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.574534s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.577196s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.581683s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.586298s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.587399s DEBUG hyper::proto::h1::io parsed 11 headers
1.587407s DEBUG hyper::proto::h1::conn incoming body is empty
1.587470s DEBUG hyper::client::pool pooling idle connection for ("http", localhost:3141)
1.587725s DEBUG hyper::client::pool reuse idle connection for ("http", localhost:3141)
1.587780s DEBUG hyper::proto::h1::io flushed 173 bytes
1.591247s DEBUG hyper::proto::h1::conn parse error (connection error: Connection reset by peer (os error 54)) with 0 bytes
1.591281s DEBUG hyper::proto::h1::dispatch read_head error: connection error: Connection reset by peer (os error 54)
1.591294s DEBUG hyper::proto::h1::conn error shutting down IO: Socket is not connected (os error 57)
1.591298s DEBUG hyper::proto::h1::decode incoming chunked header: 0x10000 (65536 bytes)
1.591317s DEBUG hyper::client::client client connection error: error shutting down connection: Socket is not connected (os error 57)
Success with real PyPI (forced HTTP/1)
0.060481s DEBUG hyper::client::connect::dns resolving host="pypi.org"
0.063307s DEBUG hyper::client::connect::http connecting to 151.101.64.223:443
0.150310s DEBUG hyper::client::connect::http connected to 151.101.64.223:443
0.263263s DEBUG hyper::proto::h1::io flushed 178 bytes
0.462894s DEBUG hyper::proto::h1::io parsed 27 headers
0.463019s DEBUG hyper::proto::h1::conn incoming body is content-length (43524 bytes)
0.673927s DEBUG hyper::proto::h1::conn incoming body completed
0.674170s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
0.698253s DEBUG hyper::client::connect::dns resolving host="files.pythonhosted.org"
0.700091s DEBUG hyper::client::connect::http connecting to 146.75.92.223:443
0.781039s DEBUG hyper::client::connect::http connected to 146.75.92.223:443
0.876690s DEBUG hyper::proto::h1::io flushed 232 bytes
1.040694s DEBUG hyper::proto::h1::io parsed 26 headers
1.040766s DEBUG hyper::proto::h1::conn incoming body is empty
1.041047s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
1.042409s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
1.042628s DEBUG hyper::proto::h1::io flushed 231 bytes
1.142697s DEBUG hyper::proto::h1::io parsed 28 headers
1.142838s DEBUG hyper::proto::h1::conn incoming body is content-length (1388317 bytes)
1.575439s DEBUG hyper::proto::h1::conn incoming body completed
1.575648s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
1.591985s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
1.592094s DEBUG hyper::client::connect::dns resolving host="pypi.org"
1.592144s DEBUG hyper::client::connect::dns resolving host="pypi.org"
1.592166s DEBUG hyper::client::connect::dns resolving host="pypi.org"
1.592193s DEBUG hyper::proto::h1::io flushed 178 bytes
1.592226s DEBUG hyper::client::connect::dns resolving host="pypi.org"
1.592256s DEBUG hyper::client::connect::dns resolving host="pypi.org"
1.595771s DEBUG hyper::client::connect::http connecting to 151.101.0.223:443
1.595873s DEBUG hyper::client::connect::http connecting to 151.101.0.223:443
1.595914s DEBUG hyper::client::connect::http connecting to 151.101.0.223:443
1.595950s DEBUG hyper::client::connect::http connecting to 151.101.0.223:443
1.595985s DEBUG hyper::client::connect::http connecting to 151.101.0.223:443
1.675531s DEBUG hyper::client::connect::http connected to 151.101.0.223:443
1.675795s DEBUG hyper::proto::h1::io parsed 27 headers
1.675812s DEBUG hyper::proto::h1::conn incoming body is content-length (11818 bytes)
1.676546s DEBUG hyper::client::connect::http connected to 151.101.0.223:443
1.678287s DEBUG hyper::client::connect::http connected to 151.101.0.223:443
1.679080s DEBUG hyper::client::connect::http connected to 151.101.0.223:443
1.679505s DEBUG hyper::client::connect::http connected to 151.101.0.223:443
1.700546s DEBUG hyper::proto::h1::conn incoming body completed
1.710953s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
1.711139s DEBUG hyper::proto::h1::io flushed 188 bytes
1.715080s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
1.715247s DEBUG hyper::proto::h1::io flushed 213 bytes
1.778483s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
1.778531s DEBUG hyper::proto::h1::io flushed 181 bytes
1.778591s DEBUG hyper::proto::h1::io flushed 182 bytes
1.778617s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
1.778649s DEBUG hyper::proto::h1::io flushed 180 bytes
1.778682s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
1.778718s DEBUG hyper::proto::h1::io flushed 185 bytes
1.781837s DEBUG hyper::proto::h1::io parsed 27 headers
1.781852s DEBUG hyper::proto::h1::conn incoming body is content-length (1734 bytes)
1.783881s DEBUG hyper::proto::h1::conn incoming body completed
1.783941s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
1.784120s DEBUG hyper::proto::h1::io parsed 26 headers
1.784131s DEBUG hyper::proto::h1::conn incoming body is empty
1.784855s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
1.785335s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
1.785447s DEBUG hyper::proto::h1::io flushed 212 bytes
1.864107s DEBUG hyper::proto::h1::io parsed 28 headers
1.864240s DEBUG hyper::proto::h1::conn incoming body is content-length (97941 bytes)
1.872114s DEBUG hyper::proto::h1::conn incoming body completed
1.872222s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
1.875444s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
1.875640s DEBUG hyper::proto::h1::io flushed 223 bytes
1.908724s DEBUG hyper::proto::h1::io parsed 27 headers
1.909505s DEBUG hyper::proto::h1::conn incoming body is content-length (9165 bytes)
1.912640s DEBUG hyper::proto::h1::io parsed 27 headers
1.912677s DEBUG hyper::proto::h1::conn incoming body is content-length (5421 bytes)
1.913940s DEBUG hyper::proto::h1::conn incoming body completed
1.914083s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
1.919122s DEBUG hyper::proto::h1::io parsed 27 headers
1.919142s DEBUG hyper::proto::h1::conn incoming body is content-length (9800 bytes)
1.919332s DEBUG hyper::proto::h1::io parsed 27 headers
1.919343s DEBUG hyper::proto::h1::conn incoming body is content-length (339489 bytes)
1.919472s DEBUG hyper::proto::h1::conn incoming body completed
1.919528s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
1.939209s DEBUG hyper::proto::h1::conn incoming body completed
1.939312s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
1.949238s DEBUG hyper::proto::h1::io parsed 30 headers
1.949299s DEBUG hyper::proto::h1::conn incoming body is empty
1.957892s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
1.958499s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
1.958664s DEBUG hyper::proto::h1::io flushed 222 bytes
2.050636s DEBUG hyper::proto::h1::io parsed 32 headers
2.050711s DEBUG hyper::proto::h1::conn incoming body is content-length (4695 bytes)
2.050850s DEBUG hyper::proto::h1::conn incoming body completed
2.055075s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.058347s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.058568s DEBUG hyper::proto::h1::io flushed 217 bytes
2.138310s DEBUG hyper::proto::h1::io parsed 29 headers
2.138372s DEBUG hyper::proto::h1::conn incoming body is empty
2.138515s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.139279s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.139456s DEBUG hyper::proto::h1::io flushed 216 bytes
2.176611s DEBUG hyper::proto::h1::conn incoming body completed
2.176800s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
2.215993s DEBUG hyper::proto::h1::io parsed 31 headers
2.216022s DEBUG hyper::proto::h1::conn incoming body is content-length (31191 bytes)
2.266282s DEBUG hyper::proto::h1::conn incoming body completed
2.266336s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.319878s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.319990s DEBUG hyper::proto::h1::io flushed 237 bytes
2.396382s DEBUG hyper::proto::h1::io parsed 26 headers
2.396401s DEBUG hyper::proto::h1::conn incoming body is empty
2.396475s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.396866s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.396946s DEBUG hyper::proto::h1::io flushed 236 bytes
2.471381s DEBUG hyper::proto::h1::io parsed 28 headers
2.471428s DEBUG hyper::proto::h1::conn incoming body is content-length (594174 bytes)
2.516206s DEBUG hyper::proto::h1::conn incoming body completed
2.516413s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.522607s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
2.522726s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
2.522797s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
2.522847s DEBUG hyper::proto::h1::io flushed 182 bytes
2.522862s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
2.522871s DEBUG hyper::proto::h1::io flushed 178 bytes
2.522926s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
2.522950s DEBUG hyper::proto::h1::io flushed 182 bytes
2.522981s DEBUG hyper::proto::h1::io flushed 183 bytes
2.523020s DEBUG hyper::proto::h1::io flushed 177 bytes
2.523031s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.523123s DEBUG hyper::proto::h1::io flushed 216 bytes
2.599296s DEBUG hyper::proto::h1::io parsed 27 headers
2.599343s DEBUG hyper::proto::h1::conn incoming body is content-length (67804 bytes)
2.599361s DEBUG hyper::proto::h1::io parsed 27 headers
2.599391s DEBUG hyper::proto::h1::conn incoming body is content-length (2020 bytes)
2.599406s DEBUG hyper::proto::h1::io parsed 29 headers
2.599457s DEBUG hyper::proto::h1::conn incoming body is empty
2.599477s DEBUG hyper::proto::h1::conn incoming body completed
2.599519s DEBUG hyper::proto::h1::io parsed 28 headers
2.599549s DEBUG hyper::proto::h1::conn incoming body is content-length (6310 bytes)
2.599684s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
2.600324s DEBUG hyper::proto::h1::io parsed 27 headers
2.600343s DEBUG hyper::proto::h1::conn incoming body is content-length (253670 bytes)
2.600466s DEBUG hyper::proto::h1::io parsed 27 headers
2.600485s DEBUG hyper::proto::h1::conn incoming body is content-length (173934 bytes)
2.601438s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.602025s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.602190s DEBUG hyper::proto::h1::io flushed 215 bytes
2.602324s DEBUG hyper::proto::h1::conn incoming body completed
2.602391s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
2.681689s DEBUG hyper::proto::h1::io parsed 31 headers
2.681716s DEBUG hyper::proto::h1::conn incoming body is content-length (53011 bytes)
2.684732s DEBUG hyper::proto::h1::conn incoming body completed
2.684852s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.687526s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.687664s DEBUG hyper::proto::h1::io flushed 220 bytes
2.703060s DEBUG hyper::proto::h1::conn incoming body completed
2.703138s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
2.769387s DEBUG hyper::proto::h1::io parsed 29 headers
2.769412s DEBUG hyper::proto::h1::conn incoming body is empty
2.770791s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.771138s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.771227s DEBUG hyper::proto::h1::io flushed 219 bytes
2.831743s DEBUG hyper::proto::h1::conn incoming body completed
2.831830s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
2.863636s DEBUG hyper::proto::h1::io parsed 31 headers
2.863651s DEBUG hyper::proto::h1::conn incoming body is content-length (17420 bytes)
2.864822s DEBUG hyper::proto::h1::conn incoming body completed
2.871613s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
2.888001s DEBUG hyper::proto::h1::conn incoming body completed
2.888060s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
2.992258s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
2.992374s DEBUG hyper::proto::h1::io flushed 217 bytes
3.070880s DEBUG hyper::proto::h1::io parsed 30 headers
3.070898s DEBUG hyper::proto::h1::conn incoming body is empty
3.070983s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.071343s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.071434s DEBUG hyper::proto::h1::io flushed 216 bytes
3.154306s DEBUG hyper::proto::h1::io parsed 32 headers
3.154386s DEBUG hyper::proto::h1::conn incoming body is content-length (7617 bytes)
3.154560s DEBUG hyper::proto::h1::conn incoming body completed
3.154676s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.157301s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.157440s DEBUG hyper::proto::h1::io flushed 214 bytes
3.250976s DEBUG hyper::proto::h1::io parsed 26 headers
3.251054s DEBUG hyper::proto::h1::conn incoming body is empty
3.251298s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.252291s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.252510s DEBUG hyper::proto::h1::io flushed 213 bytes
3.337774s DEBUG hyper::proto::h1::io parsed 28 headers
3.337948s DEBUG hyper::proto::h1::conn incoming body is content-length (61160 bytes)
3.349252s DEBUG hyper::proto::h1::conn incoming body completed
3.349488s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.356082s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.356295s DEBUG hyper::proto::h1::io flushed 240 bytes
3.431366s DEBUG hyper::proto::h1::io parsed 26 headers
3.431431s DEBUG hyper::proto::h1::conn incoming body is empty
3.431676s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.432486s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.432689s DEBUG hyper::proto::h1::io flushed 239 bytes
3.507570s DEBUG hyper::proto::h1::io parsed 28 headers
3.507700s DEBUG hyper::proto::h1::conn incoming body is content-length (97060 bytes)
3.510338s DEBUG hyper::proto::h1::conn incoming body completed
3.510622s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.524711s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.525333s DEBUG hyper::proto::h1::io flushed 239 bytes
3.609028s DEBUG hyper::proto::h1::io parsed 28 headers
3.609109s DEBUG hyper::proto::h1::conn incoming body is empty
3.609396s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.610378s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.611059s DEBUG hyper::proto::h1::io flushed 238 bytes
3.688442s DEBUG hyper::proto::h1::io parsed 30 headers
3.688556s DEBUG hyper::proto::h1::conn incoming body is content-length (48546 bytes)
3.698714s DEBUG hyper::proto::h1::conn incoming body completed
3.699126s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.705202s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.705438s DEBUG hyper::proto::h1::io flushed 234 bytes
3.784947s DEBUG hyper::proto::h1::io parsed 26 headers
3.785065s DEBUG hyper::proto::h1::conn incoming body is empty
3.786824s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.789373s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.789639s DEBUG hyper::proto::h1::io flushed 233 bytes
3.869434s DEBUG hyper::proto::h1::io parsed 28 headers
3.869773s DEBUG hyper::proto::h1::conn incoming body is content-length (132836 bytes)
3.875270s DEBUG hyper::proto::h1::conn incoming body completed
3.875483s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
3.892064s DEBUG hyper::client::pool reuse idle connection for ("https", pypi.org)
3.892355s DEBUG hyper::proto::h1::io flushed 177 bytes
3.973131s DEBUG hyper::proto::h1::io parsed 27 headers
3.973205s DEBUG hyper::proto::h1::conn incoming body is content-length (5573 bytes)
3.973399s DEBUG hyper::proto::h1::conn incoming body completed
3.973512s DEBUG hyper::client::pool pooling idle connection for ("https", pypi.org)
3.979862s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
3.980063s DEBUG hyper::proto::h1::io flushed 210 bytes
4.067872s DEBUG hyper::proto::h1::io parsed 29 headers
4.068012s DEBUG hyper::proto::h1::conn incoming body is empty
4.068462s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.082752s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
4.084303s DEBUG hyper::proto::h1::io flushed 209 bytes
4.160366s DEBUG hyper::proto::h1::io parsed 31 headers
4.160615s DEBUG hyper::proto::h1::conn incoming body is content-length (61567 bytes)
4.167167s DEBUG hyper::proto::h1::conn incoming body completed
4.167461s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.187474s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
4.187772s DEBUG hyper::proto::h1::io flushed 231 bytes
4.187856s DEBUG hyper::client::connect::dns resolving host="files.pythonhosted.org"
4.188030s DEBUG hyper::client::connect::dns resolving host="files.pythonhosted.org"
4.188239s DEBUG hyper::client::connect::dns resolving host="files.pythonhosted.org"
4.188342s DEBUG hyper::client::connect::dns resolving host="files.pythonhosted.org"
4.188495s DEBUG hyper::client::connect::dns resolving host="files.pythonhosted.org"
4.188701s DEBUG hyper::client::connect::dns resolving host="files.pythonhosted.org"
4.191888s DEBUG hyper::client::connect::http connecting to 146.75.92.223:443
4.192150s DEBUG hyper::client::connect::http connecting to 146.75.92.223:443
4.192694s DEBUG hyper::client::connect::http connecting to 146.75.92.223:443
4.193342s DEBUG hyper::client::connect::http connecting to 146.75.92.223:443
4.193506s DEBUG hyper::client::connect::http connecting to 146.75.92.223:443
4.193631s DEBUG hyper::client::connect::http connecting to 146.75.92.223:443
4.291396s DEBUG hyper::client::connect::http connected to 146.75.92.223:443
4.291549s DEBUG hyper::proto::h1::io parsed 28 headers
4.291573s DEBUG hyper::proto::h1::conn incoming body is content-length (1388317 bytes)
4.296258s DEBUG hyper::client::connect::http connected to 146.75.92.223:443
4.297164s DEBUG hyper::client::connect::http connected to 146.75.92.223:443
4.297920s DEBUG hyper::client::connect::http connected to 146.75.92.223:443
4.298674s DEBUG hyper::client::connect::http connected to 146.75.92.223:443
4.299442s DEBUG hyper::client::connect::http connected to 146.75.92.223:443
4.341646s DEBUG hyper::proto::h1::conn incoming body completed
4.342080s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
4.342406s DEBUG hyper::proto::h1::io flushed 236 bytes
4.369519s DEBUG hyper::proto::h1::io flushed 215 bytes
4.387377s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
4.387414s DEBUG hyper::proto::h1::io flushed 219 bytes
4.387431s DEBUG hyper::client::pool reuse idle connection for ("https", files.pythonhosted.org)
4.387445s DEBUG hyper::proto::h1::io flushed 212 bytes
4.387473s DEBUG hyper::proto::h1::io flushed 216 bytes
4.387480s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.387503s DEBUG hyper::proto::h1::io flushed 222 bytes
4.435453s DEBUG hyper::proto::h1::io parsed 28 headers
4.435470s DEBUG hyper::proto::h1::conn incoming body is content-length (594174 bytes)
4.456318s DEBUG hyper::proto::h1::conn incoming body completed
4.456377s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.564856s DEBUG hyper::proto::h1::io parsed 31 headers
4.564892s DEBUG hyper::proto::h1::conn incoming body is content-length (53011 bytes)
4.565148s DEBUG hyper::proto::h1::io parsed 31 headers
4.565160s DEBUG hyper::proto::h1::conn incoming body is content-length (31191 bytes)
4.565442s DEBUG hyper::proto::h1::io parsed 31 headers
4.565454s DEBUG hyper::proto::h1::conn incoming body is content-length (17420 bytes)
4.565613s DEBUG hyper::proto::h1::io parsed 28 headers
4.565625s DEBUG hyper::proto::h1::conn incoming body is content-length (97941 bytes)
4.567136s DEBUG hyper::proto::h1::io parsed 32 headers
4.567159s DEBUG hyper::proto::h1::conn incoming body is content-length (4695 bytes)
4.567304s DEBUG hyper::proto::h1::conn incoming body completed
4.567359s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.581377s DEBUG hyper::proto::h1::conn incoming body completed
4.581497s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.590031s DEBUG hyper::proto::h1::conn incoming body completed
4.590112s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.657938s DEBUG hyper::proto::h1::conn incoming body completed
4.658021s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)
4.681223s DEBUG hyper::proto::h1::conn incoming body completed
4.681327s DEBUG hyper::client::pool pooling idle connection for ("https", files.pythonhosted.org)

from devpi.

zanieb avatar zanieb commented on September 21, 2024

I can easily reproduce with the following

import httpx
import anyio
import traceback


TARGETS = [
    "http://localhost:3141/root/pypi/%2Bf/11c/8f37bcca40db9/platformdirs-4.1.0-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/ae7/4fb96c20a0277/click-8.1.7-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/f83/76fb07dd1e86a/aiosignal-1.3.1-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/1f2/8b4522cdc2fb4/attrs-23.1.0-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/8c4/91190033a9af7/packaging-23.2-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/fde/5bd59ab5357e3/frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/c05/567e9c24a6b9f/idna-3.6-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/a0d/503e138a4c123/pathspec-0.12.1-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/d8a/1c6c0be645c74/yarl-1.9.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/439/2f6c0eb8a5668/mypy_extensions-1.0.0-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/ff9/59bee35038c46/multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/8ce/f8710fb849d97/aiohttp-3.9.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/c05/567e9c24a6b9f/idna-3.6-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/fde/5bd59ab5357e3/frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/1f2/8b4522cdc2fb4/attrs-23.1.0-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/ff9/59bee35038c46/multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/ff9/59bee35038c46/multidict-6.0.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/d8a/1c6c0be645c74/yarl-1.9.4-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/fde/5bd59ab5357e3/frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl",
    "http://localhost:3141/root/pypi/%2Bf/f83/76fb07dd1e86a/aiosignal-1.3.1-py3-none-any.whl",
    "http://localhost:3141/root/pypi/%2Bf/c05/567e9c24a6b9f/idna-3.6-py3-none-any.whl",
]

FAILURE = []
SUCCESS = 0


async def head(client: httpx.AsyncClient, url: str):
    global SUCCESS
    try:
        response = await client.head(url)
        response.raise_for_status()
    except Exception as exc:
        FAILURE.append(exc)
    else:
        SUCCESS += 1

    print(".", end="")


async def main():
    async with httpx.AsyncClient(timeout=httpx.Timeout(timeout=300)) as client:
        async with anyio.create_task_group() as tg:
            for _ in range(100):
                for url in TARGETS:
                    tg.start_soon(head, client, url)


anyio.run(main)

print()
seen = set()
for exc in FAILURE:
    if type(exc) in seen:
        continue
    seen.add(type(exc))
    print()
    traceback.print_exception(exc)
    print()

print()
print(f"{len(FAILURE)}/{len(FAILURE) + SUCCESS} requests failed")
print(f"Printed {len(seen)} unique exception types")

Notably, this appears to be an issue with the HEAD handling. This also fails with just one TARGET URL (with more requests).

These particular URLs require macOS and Python 3.11. You can populate them with the following (although I'd recommend just choosing a wheel in your index):

pip install flask==3.0.0 --index-url "http://localhost:8000/root/pypi/+simple" --force-reinstall

platformdirs==4.1.0
click==8.1.7
aiosignal==1.3.1
attrs==23.1.0
packaging==23.2
frozenlist==1.4.1
idna==3.6
pathspec==0.12.1
yarl==1.9.4
mypy_extensions==1.0.0
multidict==6.0.4
aiohttp==3.9.1
idna==3.6
frozenlist==1.4.1
attrs==23.1.0
multidict==6.0.4
multidict==6.0.4
yarl==1.9.4
frozenlist==1.4.1
aiosignal==1.3.1
idna==3.6

from devpi.

zanieb avatar zanieb commented on September 21, 2024

I've opened an issue over on waitress as I can reproduce it with a trivial waitress server: Pylons/waitress#427

from devpi.

fschulze avatar fschulze commented on September 21, 2024

I guess with the waitress 3.0.0 release this can be closed?

from devpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.