uv icon indicating copy to clipboard operation
uv copied to clipboard

Intermittent "channel closed" errors when using `pypiserver` with high levels of concurrency

Open zanieb opened this issue 1 year ago • 1 comments

When testing against a local pypiserver, uv errors with

error: error sending request for url (http://localhost:3141/simple/albatross/): channel closed
    Caused by: channel closed

This is resolved by limiting parallelism of the test threads. There are no errors in the server logs.

Looks like this may be an upstream issue:

  • https://github.com/seanmonstar/reqwest/issues/1221

zanieb avatar Mar 02 '24 18:03 zanieb

I'm hitting this error a lot when installing from a local server.

This is resolved by limiting parallelism of the test threads.

What is the appropriate way to limit the number of threads here please? :) I'd be happy to make things a bit slower to resolve this issue.

patrick-kidger avatar May 10 '24 14:05 patrick-kidger

Sorry you're hitting it. I kind of think it's a pypiserver bug, I haven't seen this elsehwere.

For limiting concurrency, see #3493 — we're about to release UV_CONCURRENT_DOWNLOADS for this purpose.

zanieb avatar May 11 '24 02:05 zanieb

Ah, thank you! Indeed that seems to resolve things for me.

For the sake of any future readers: in my case the local server is an implementation I control. For reasons that are a little beyond my ken, switching the implementation from http.server to flask also seems to have resolved this issue (without needing to restrict uv's concurrency).

patrick-kidger avatar May 11 '24 15:05 patrick-kidger