httpx: Connect Timeout confusion

Hi!

I’m quite confused about Connect Timeout. I observed that I have some applications that happens to throw a ConnectionTimeout exception in httpx/backends/asyncio.py, in this part (lines 201, 202):

except asyncio.TimeoutError:
	raise ConnectTimeout()

What I think is strange is that, my applications are monitored with NewRelic and Microsoft Application Insights, and although they say that a request took something like 5s, I can find the request in the origin and it took just some milliseconds.

So I think my question here is this: is there something in the origin application that can cause this timeout? Maybe some blocking code? Or wrong AsyncClient creation?

Any help would be appreciated, thanks!

Obs: my applications are developed using FastAPI

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 29 (8 by maintainers)

Most upvoted comments

@florimondmanca one point is that here I raised many types of errors and described receiving ConnectTimeout errors that make no sense.

On #841 the errors are ReadTimeout and KeyError, which in the end can be the same problem (maybe ?) or not.