Fine-grained timeout for httpx
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 304
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 37
Description
Timeout param type has been changed in QdrantClient from Optional[float] to Optional[int] to be on par with other timeouts.
Some users used to pass not supported httpx.Timeout, which allowed more fine-grained control over timeouts.
While I don't consider it to be a bad idea, it is doubtful for me whether we would like to explicitly add support for httpx.Timeout, or not, since it is not applicable to gRPC.
What can be painless at the moment is to ease the condition which prevents using types other than those allowed by math.ceil
While the decision has not been made yet, using types other than allowed by the interface is on the users risk
Hello @joein,
I feel this PR introduces a regression. We used to provide anhttpx.Timeoutobject to ourQdrantClient, which, although it wasn't compliant with the typings, allowed fine-grained timeout management between connect, read and write timeouts. Maybe it would be more appropriate to change the parameter type toUnion[float, httpx.Timeout, None]and handle the types with dedicated logic in the constructor ?
Originally posted by @LouisAuneau in https://github.com/qdrant/qdrant-client/issues/443#issuecomment-1901308986
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting QdrantClient's timeout parameter handling and the condition involving math.ceil. Compare the HTTP and gRPC timeout paths, then resolve whether httpx.Timeout should be supported or whether only the existing timeout values should be accepted. Done means the supported behavior and type handling are clearly decided and validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100