feat(snuba): handle TOO_MANY_BYTES as clickhouse error instead of 429#109747
feat(snuba): handle TOO_MANY_BYTES as clickhouse error instead of 429#109747
Conversation
…e limit Add QueryBytesScannedExceeded exception for ClickHouse error code 307 (TOO_MANY_BYTES). This is raised when a query exceeds the max_bytes_to_read limit set by an allocation policy, distinct from Snuba-level rate limiting. - Add QueryBytesScannedExceeded to clickhouse_error_codes_map (code 307) - Handle it explicitly in handle_query_errors() before the generic QueryExecutionError catch, returning a descriptive error message Co-authored-by: Claude <noreply@anthropic.com>
kylemumma
left a comment
There was a problem hiding this comment.
Could you explain how this is different from snuba allocation policy? Allocation policy exceeded seems like a 4xx error not a 5xx
@onewland has more context, this is in conjunction with getsentry/snuba#7782 such that if a user runs a query that will always exceed their bytes scanned allocation policy, they get a 400 rather than a 429. not sure if we want to continue this direction though |
|
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Add QueryBytesScannedExceeded exception for ClickHouse error code 307 (TOO_MANY_BYTES). This is raised when a query exceeds the max_bytes_to_read limit set by an allocation policy.