-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NewConnectionRequired exception raised when running behind a proxy #335
Comments
Update: I've managed to create a small example to reproduce the issue: import httpx
from concurrent.futures import ThreadPoolExecutor
with httpx.Client() as client:
with ThreadPoolExecutor() as ex:
for response in ex.map(lambda i: client.get("https://httpbin.org"), range(1000)):
print(response) This gives the following output:
Also, reducing the number of connections in the pool ( |
Okay, firstly - this is a really nicely described issue - thanks for your efforts in reducing it to a nice simple case. And yes, I can reproduce this. I'm using And yes, it is a bug - that's an internal exception, that you shouldn't be seeing escape out of httpcore. Btw...
|
Glad I was able to describe the bug well for you. The tracebacks are nice, aren't they. The come from the logging package I'm trying out - loguru - as an unexpected benefit. |
The pretty tracebacks specifically seem to be provided by this package.. https://github.com/Qix-/better-exceptions |
Any updates on this? I'm encountering these quite often on |
@Granitosaurus I'm working towards resolving this, but there's some bits of refactoring I'm need to do first in order to be able to tackle it. |
This sort of thing is the preliminary work... #353 |
Any version ETA? |
+1, using httpx with AsyncClient, every few requests I get this error, ignoring for now. |
Signed-off-by: Eyan <[email protected]>
Signed-off-by: Eyan <[email protected]>
Closed by 0.14 |
Environment
Windows 10, 64 bit
Python 3.9.2
httpx 0.18.1
httpcore 0.13.3
ZScaler proxy running on localhost (set via
http{s}_proxy
environment variables).Problem
I'm writing some threaded code using httpx, and I've just started getting
NewConnectionRequired
errors in my test runs. I don't think I've changed anything that would affect the http call, but I am currently running on a work network which uses a HTTP proxy. I notice in the traceback thathttpcore\_sync\http_proxy.py
shows up, so maybe that implies it's the proxy that's the trigger for the problem?My main concern here is that the exception doesn't give me any idea what I need to do to fix the issue, if it is a problem with my code or environment, and there's no documentation that I could find of what the exception means.
I'm reporting this here even though I'm not entirely sure if it's a bug - but even if it is a problem in my program or environment, a better error (or some documentation) would be welcome 🙂
I include a traceback from the error in case it's of any use in working out what the problem is.
The text was updated successfully, but these errors were encountered: