-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance json parser error logging to better track Istio Proxy error message #15176
Enhance json parser error logging to better track Istio Proxy error message #15176
Conversation
… would greatly help tracing to the root of error in case istio proxy return unexpected error messages during meeting connection issues.
server/src/main/java/org/apache/druid/client/JsonParserIterator.java
Outdated
Show resolved
Hide resolved
Thanks for the PR @kaisun2000 . Please add test cases for this change. |
server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java
Fixed
Show fixed
Hide fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the changes its a +1 from my side.
server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/apache/druid/client/JsonParserIteratorTest.java
Outdated
Show resolved
Hide resolved
public static class IAEExceptionConversionTest | ||
{ | ||
@Rule | ||
public ExpectedException expectedException = ExpectedException.none(); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
ExpectedException.none
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kaisun2000 for the contribution.
Change LGTM.
…essage (apache#15176) Currently the inter Druid communication via rest endpoints is based on json formatted payload. Upon parsing error, there is only a generic exception stating expected json token type and current json token type. There is no detailed error log about the content of the payload causing the violation. In the micro-service world, the trend is to deploy the Druid servers in k8 with the mesh network. Often the istio proxy or other proxies is used to intercept the network connection between Druid servers. The proxy may give error messages for various reasons. These error messages are not expected by the json parser. The generic error message from Druid can be very misleading as the user may think the message is based on the response from the other Druid server. For example, this is an example of mysterious error message QueryInterruptedException{msg=Next token wasn't a START_ARRAY, was[VALUE_STRING] from url[http://xxxxx:8088/druid/v2/], code=Unknown exception, class=org.apache.druid.java.util.common.IAE, host=xxxxx:8088}" While the context of the message is the following from the proxy when it can't tunnel the network connection. pstream connect error or disconnect/reset before header So this very simple PR is just to enhance the logging and get the real underlying message printed out. This would save a lot of head scratching time if Druid is deployed with mesh network. Co-authored-by: Kai Sun <[email protected]>
Description
Currently the inter Druid communication via rest endpoints is based on json formatted payload. Upon parsing error, there is only a generic exception stating expected json token type and current json token type. There is no detailed error log about the content of the payload causing the violation.
In the micro-service world, the trend is to deploy the Druid servers in k8 with the mesh network. Often the istio proxy or other proxies is used to intercept the network connection between Druid servers. The proxy may give error messages for various reasons. These error messages are not expected by the json parser. The generic error message from Druid can be very misleading as the user may think the message is based on the response from the other Druid server.
For example, this is an example of mysterious error message
While the context of the message is the following from the proxy when it can't tunnel the network connection.
So this very simple PR is just to enhance the logging and get the real underlying message printed out. This would save a lot of head scratching time if Druid is deployed with mesh network.
Release note
Improved: enhanced the json parser unexpected token logging with the context of the expected VALUE_STRING token. This way, it is easier to track to mesh/proxy network error messages, instead misleading user to track the Druid server rest endpoint responses.
This PR has: