click_house icon indicating copy to clipboard operation
click_house copied to clipboard

Add read time and support adaptor options (timeout fix with httpx)

Open poweroftrue opened this issue 1 year ago • 0 comments

Hello @shlima,

Your work is a piece of art.

I have faced an issue where timeout doesn't work if the request is opened successfully, it just freezes indefinitely, you can reproduce it using this query (Clickhouse doesn't support sleep longer than three seconds):

-- sleep/process for a long time
SELECT sum(pow(number, 0.5)) FROM numbers(1000000000000)

I was able to fix using @HoneyryderChuck's httpx, and based on this article https://honeyryderchuck.gitlab.io/2023/10/15/state-of-ruby-http-clients-use-httpx.html it seems httpx the best option, I think we should move click_house to use it.

When I used it the timeout worked but I needed to add support for adaptor option to pass things like retires and persistent: false

I also added read timeout support.

poweroftrue avatar Feb 13 '24 00:02 poweroftrue