capistrant opened a new pull request, #20529:
URL: https://github.com/apache/druid/pull/20529

   ### Description
   
   #11711 added functionality for creating runtime transformations to error 
messages according to a policy. The initial policy was a regex that can be used 
to sanitize what errors pass through to callers. #18487 added a new policy, 
`persona`. The `persona` policy hides non-user persona error details from 
clients, and instead gives them a generic error with an ID that an operator can 
take to troubleshoot more deeply. In investigating how I may leverage this 
policy for a use case, I found that the transformations were not always taking 
effect and some other apparent issues existed.
   
   This PR aims to close some of the gaps in the implementation to give more 
complete coverage to the documented feature. 
   
   1. Errors raised during query execution are now transformed.
       * Previously DruidExceptions thrown during query run bypassed the 
strategy, allowing operator facing errors to reach the client.
       * Failures during execution that are transformed now log an Error ID 
with the generated ID to help with operator finding and correlating the user 
facing error to what happened under the hood.
   2. Legacy QueryExceptions now map to a persona via `QueryExceptionCompat`. 
This allows these exceptions to be transformed as well now.
       * This does result in some persona field changes from `OPERATOR` to 
`USER`
   4. `persona` issue for JDBC and Druid router errors fixed. 
`transformIfNeeded` was calling `getErrorMessageTransformFunction` which threw 
`UnsupportedOperationException`. persona now implements `transformIfNeeded` so 
the policy can transform JDBC and router generated errors
   5. Invalid native json now passes through the strategy
   
   #### Release note
   
   Fixed gaps in `druid.server.http.errorResponseTransform`
   * Errors raised while a query is running are now transformed instead of 
passing through to client unchanged
   * JDBC errors and errors raised by the router are now transformed
   
   <hr>
   
   ##### Key changed/added classes in this PR
   - QueryResultPusher
   - QueryResourceQueryResultPusherFactory
   - SqlResourceQueryResultPusher
   - QueryResource
   - PersonaBasedErrorTransformStrategy
   - QueryExceptionCompat
   - docs/configuration/index.md
   
   <hr>
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not 
all of these items apply to every PR. Remove the items which are not done or 
not relevant to the PR. None of the items from the checklist below are strictly 
necessary, but it would be very helpful if you at least self-review the PR. -->
   
   This PR has:
   
   - [ ] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] 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.
   - [ ] 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.

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]

Reply via email to