fix: ensure native query statusCode is 403 for blocklist - #19745
Conversation
6a2bbab to
a559622
Compare
| // Handled separately from QueryException so that the exception's own category (for example FORBIDDEN for a | ||
| // blocklisted query) determines the status code. Wrapping it below would erase that and report a 500. | ||
| return QueryResultPusher.handleDruidExceptionBeforeResponseStarted( | ||
| e, |
There was a problem hiding this comment.
Do we need to transform using serverConfig.getErrorResponseTransformStrategy()
| return QueryResultPusher.handleDruidExceptionBeforeResponseStarted( | ||
| e, | ||
| MediaType.valueOf(io.getResponseWriter().getResponseType()), | ||
| ImmutableMap.of() |
There was a problem hiding this comment.
Do we need to add QUERY_ID_RESPONSE_HEADER to this Map?
FrankChen021
left a comment
There was a problem hiding this comment.
I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.
Reviewed 3 of 3 changed files.
This is an automated review by Codex GPT-5.6-Sol
222d935 to
bd348f6
Compare
bd348f6 to
e7f46d1
Compare
FrankChen021
left a comment
There was a problem hiding this comment.
I have reviewed the code for correctness, edge cases, concurrency, and integration risks; no issues found.
Since the prior review, the PR centralizes DruidException sanitization, preserves original errors for server metrics and logs, adds query identity before blocklist failure, and wires ServerConfig through native and SQL pushers. The 403 blocklist and transformed-error paths are coherently covered.
Reviewed 13 of 13 changed files.
Validation: git diff --check passed.
This is an automated review by Codex GPT-5.6-Sol
Description
This makes sure that any DruidExceptions thrown during query processing are correctly propagated with the correct status code for native queries.
Release note
Ensure native query statusCode is 403 for query blocklist
This PR has: