qdrant-client icon indicating copy to clipboard operation
qdrant-client copied to clipboard

Fine-grained timeout for httpx

Open joein opened this issue 1 year ago • 2 comments

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 an httpx.Timeout object to our QdrantClient, 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 to Union[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

joein avatar Jan 20 '24 09:01 joein

@LouisAuneau unfortunately, we can't just ease the condition due to mypy complaints, we would need to do another workaround, but it won't be available in 1.7.2 :(

we will come back to it later

joein avatar Jan 31 '24 15:01 joein

Thanks for your feedback @joein. For now we set an upper bound to 1.7.0 to solve the problem.

LouisAuneau avatar Jan 31 '24 16:01 LouisAuneau