pydantic / pydantic/httpx2

Inconsistent Timeout Exception

Open
#805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
78
Avg merge
8h 59m
Merged PRs (30d)
24

Description

Originally opened by @ChihweiLHBird on 2023-12-21 19:35:48 in encode/httpx

httpx.get("https://www.google.com", timeout=0.0000001) raises:
httpx.ConnectError: [Errno 65] No route to host

httpx.get("https://www.google.com", timeout=0.05) raises:
httpx.ConnectTimeout: _ssl.c:983: The handshake operation timed out

httpx.get("https://www.google.com", timeout=0.015) raises:
httpx.ReadTimeout: The read operation timed out

Your mileage may vary depends on the latency between your location and the Google server.

I think ideally all timeouts of operation should raise a consistent exception from httpx client.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the three reported httpx.get timeout calls with the example timeout values and compare the resulting exceptions. Trace the timeout handling from these entry points; done means the reported timeout operations consistently raise one httpx timeout exception rather than varying by phase.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.