Inconsistent Timeout Exception

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

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.

Dominant language
Python
Stars
1.6k
Forks
103
Avg merge
1d 19h
Merged PRs (30d)
25

Getting set up

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.

More from pydantic/httpx2

All issues in pydantic/httpx2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.