shoemoney commented on PR #20151: URL: https://github.com/apache/druid/pull/20151#issuecomment-5529487862
Pushed c459a6e, which folds #20152 into this PR and addresses both findings: - **JSON 503 misclassified**: the 429/503 shortcut now fires only when the body prefix is confirmed non-JSON (HTML, or e.g. Envoy's plain-text "upstream connect error"). A 429/503 carrying Druid's own JSON error body falls through to the normal parse path, so `JsonParserIterator` surfaces the server's real `QueryException`. Covered by `testJson503IsNotShortCircuited`. - **Chunked HTML bypassing classification**: the initial status is remembered, and the prefix check is retried per chunk until it resolves, so a 503 whose first buffer is empty and whose HTML arrives in chunk 2 is still reported as capacity-exceeded. Covered by `testHtml503InLaterChunkAfterEmptyInitialBodyIsCapacityExceeded`. - **Chunk-handler exception lost**: `NettyHttpClient`'s catch block now routes through `handleExceptionAndCloseChannel`, so an exception from `handleChunk` reaches `handler.exceptionCaught` as itself instead of being replaced by the "Channel disconnected" `ChannelException` from the resulting close. `testHandleChunkExceptionReachesExceptionCaught` drives a real chunked socket response for this. `DirectDruidClientTest` (17) and `NettyHttpClientTest` (2) pass locally with checkstyle. Closing #20152 now that this carries its diff. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
