v.22.6Improvement

Modify HTTP Endpoint for Improved Status Reporting and Error Handling

Modify the HTTP Endpoint to return the full stats under the X-ClickHouse-Summary header when send_progress_in_http_headers=0 (before it would return all zeros). - Modify the HTTP Endpoint to return X-ClickHouse-Exception-Code header when progress has been sent before (send_progress_in_http_headers=1) - Modify the HTTP Endpoint to return HTTP_REQUEST_TIMEOUT (408) instead of HTTP_INTERNAL_SERVER_ERROR (500) on TIMEOUT_EXCEEDED errors. #36884 (Raúl Marín).
Enhance the HTTP endpoint to provide more accurate and comprehensive response headers, including full stats and proper error codes.

Why it matters

Previously, when send_progress_in_http_headers=0, the HTTP endpoint returned zeroed stats in the X-ClickHouse-Summary header. This update ensures full statistics are returned, improving observability. Additionally, it adds the X-ClickHouse-Exception-Code header when progress is sent via headers (send_progress_in_http_headers=1) for better error identification. The HTTP status code for timeout errors is changed from 500 to the more appropriate 408, improving error handling accuracy.

How to use it

To enable full stats in HTTP response headers, set send_progress_in_http_headers=0. When set to 1, you will receive the X-ClickHouse-Exception-Code header upon errors. Timeout errors during HTTP requests will now return the 408 status code automatically without additional configuration.