Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert error header into request error #182

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

phil-schreiber
Copy link
Contributor

@phil-schreiber phil-schreiber commented Jun 10, 2024

We recently noticed that the clickhouse http interface can return Status 200 ok for failing queries. In particular when clickhouse runs into a socket read timeout for inserts, it will return a 200 but not write any data. In these cases it injects an error header, which remains unevaluated in the libs current implementation. Also it's not possible to evaluate the response client-side because the response is discarded here: https://github.com/mailru/go-clickhouse/blob/master/stmt.go#L111
In order not to change the libs interface we suggest to raise an error, if the error header is present in the connection request code

The underlying issue is the same as for https://github.com/mailru/go-clickhouse/pull/107/files (which was closed). But the fix then (wait_query_end=1) won't help in our case, because the response body is not returned and doesn't contain an error. The error is only in the exception header

@DoubleDi
Copy link
Collaborator

Sorry for the long wait. Since it is hard to test this, allow me to merge this.

@DoubleDi DoubleDi merged commit 557cddc into mailru:master Sep 21, 2024
5 checks passed
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