You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/05/18 01:34:58 UTC

[GitHub] [druid] FrankChen021 opened a new pull request #11266: Fix ClassCastException in movingAverage

FrankChen021 opened a new pull request #11266:
URL: https://github.com/apache/druid/pull/11266


   Fixes #10799 
   
   ### Description
   
   This PR fixes a ClassCastException in broker when issuing a moving average query. This exception appears after changes made in #10082  since 0.19.
   
   In 10082, `REMAINING_RESPONSES_FROM_QUERY_SERVERS` is added to `ResponseContext` as a hash map
   
   https://github.com/apache/druid/blob/3be8e29269f0865798840312a8475f9c2db7d0a7/server/src/main/java/org/apache/druid/client/DirectDruidClient.java#L121
   
   And when a query is executed, the right server num is added to this hash map.
   
   https://github.com/apache/druid/blob/3be8e29269f0865798840312a8475f9c2db7d0a7/server/src/main/java/org/apache/druid/client/CachingClusteredClient.java#L217-L220
   
   While for moving average query, it constructs a new ResponseContext object by itself and of course does not initialize such hash map object, when executing the code above, it triggers the exception.
   
   This PR fixes the code in moving average by copying all objects in response context from caller to the response object it creates so that all initialization for response context won't be missed for such query.
   
   For testing, it's better to add an integration test for this bug. Currently there's no IT integrated for community contributed extensions, I don't add the test but test this change on my computer.
   
   This PR has:
   - [X] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [X] been tested in a test Druid cluster.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] suneet-s merged pull request #11266: Fix ClassCastException in movingAverage

Posted by GitBox <gi...@apache.org>.
suneet-s merged pull request #11266:
URL: https://github.com/apache/druid/pull/11266


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] suneet-s commented on pull request #11266: Fix ClassCastException in movingAverage

Posted by GitBox <gi...@apache.org>.
suneet-s commented on pull request #11266:
URL: https://github.com/apache/druid/pull/11266#issuecomment-849645323


   @FrankChen021 do you think this is good to merge?


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11266: Fix ClassCastException in movingAverage

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11266:
URL: https://github.com/apache/druid/pull/11266#issuecomment-845840161


   Hi @nishantmonu51 This exception is thrown when broker receives response from historical through http call. For this extension, it makes no sense to add a unit test to cover this case.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] FrankChen021 commented on pull request #11266: Fix ClassCastException in movingAverage

Posted by GitBox <gi...@apache.org>.
FrankChen021 commented on pull request #11266:
URL: https://github.com/apache/druid/pull/11266#issuecomment-849651576


   > @FrankChen021 do you think this is good to merge?
   
   Yes,it could be merged.


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org