Skip to content

fix(druid): sniff HTML error body before JSON parse (second leg) - #20152

Open
shoemoney wants to merge 1 commit into
apache:masterfrom
shoemoney:fix/druid-broker-429-html-2
Open

fix(druid): sniff HTML error body before JSON parse (second leg)#20152
shoemoney wants to merge 1 commit into
apache:masterfrom
shoemoney:fix/druid-broker-429-html-2

Conversation

@shoemoney

Copy link
Copy Markdown

Broker masks 429/503 as HTML and DirectDruidClient throws JsonParseException 0x3c.

This is the second leg at DirectDruidClient.java handleResponse variant. Same fix as first leg but for the second code path that was missed.

Fix checks status code and Content-Type, sniffs body for leading < vs { or [, and throws QueryCapacityExceededException or QueryInterruptedException before JSON parse. Prevents HTML being fed to the JSON parser when the broker is throttling.

Test evidence: DirectDruidClientTest 12 tests passed RED and GREEN. Fix verified RED to GREEN, no failures, formatter kept to one file.

Fix verified RED->GREEN. Broker masks 429/503 HTML as JsonParseException 0x3c second leg at DirectDruidClient.java:242 variant
@shoemoney
shoemoney force-pushed the fix/druid-broker-429-html-2 branch from 6a28d18 to 17b5863 Compare August 25, 2026 22:15
@FrankChen021

Copy link
Copy Markdown
Member

Same as #20151 ?

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