Skip to content

Conversation

@poweroftrue
Copy link

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.

Signed-off-by: Mostafa Dahab <mostafa@dahab.io>
Signed-off-by: Mostafa Dahab <mostafa@dahab.io>
Clickhouse sometimes returns a Content type starting with `text/plain` when the body is actually JSON.

As a temporary fix, we'll handle this case by attempting to parse the string into JSON, and if that works, we'll continue with `body` being a `Hash`.

If it doesn't work, we'll proceed as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants