Fix mertric reporting error for MSQ task posts to router#19066
Open
capistrant wants to merge 2 commits intoapache:masterfrom
Open
Fix mertric reporting error for MSQ task posts to router#19066capistrant wants to merge 2 commits intoapache:masterfrom
capistrant wants to merge 2 commits intoapache:masterfrom
Conversation
jtuglu1
approved these changes
Feb 27, 2026
Contributor
jtuglu1
left a comment
There was a problem hiding this comment.
LGTM – thanks for catching this. Left one comment.
| } | ||
|
|
||
| final boolean success = result.isSucceeded() && result.getResponse().getStatus() == Status.OK.getStatusCode(); | ||
| List<Integer> successStatusCodes = List.of(Status.OK.getStatusCode(), Status.ACCEPTED.getStatusCode()); |
Contributor
There was a problem hiding this comment.
nit: can we make this a private method isSuccessStatus that does a match over the status code?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
#18639 introduced changes to improve router metrics reporting for queries. It introduced an issue where MSQ tasks
/druid/v2/sql/tasknow report as failed inquery/timebecause their status code is202 Acceptedwhile the aforementioned PR is checking strictly for200 OKRelease note
Fixes a metric reporting bug on the router where successful MSQ Task requests (
POST /druid/v2/sql/task) were causing the router to erroneously emit aquery/timemetric with a status of failed instead of success.Key changed/added classes in this PR
AsyncQueryForwardingServletThis PR has: