-
Notifications
You must be signed in to change notification settings - Fork 2.8k
increase more logs, and return appropriate error to front-end #1051
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
Closed
Conversation
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
| logger.error("Cannot run " + sql, e); | ||
| if (e.getMessage() == null) { | ||
| return new InterpreterResult(Code.ERROR, StringUtils.join(e.getStackTrace(), "\n")); | ||
| } |
Member
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.
How about adding e.getStackTrace() if e.getMessage() != null?
Contributor
Author
|
@jongyoul Thank you for the review, have made relevant change. |
Member
|
LGTM |
Contributor
Author
|
CI fails for #5104.1 #5104.7 Which looks unrelated. |
6 tasks
Contributor
Author
|
Merging this if no more discussion. |
asfgit
pushed a commit
that referenced
this pull request
Jun 22, 2016
### What is this PR for? In the current implementation JDBC interpret only catches SQLException and ClassNotFoundException. However, there can be a case for example NullPointerException or for that matter anything else can be thrown. ### What type of PR is it? [Improvement] ### Todos * [x] - increase more logs, and return appropriate error to front-end ### What is the Jira issue? * Open an issue on Jira https://issues.apache.org/jira/browse/ZEPPELIN/ * Put link here, and add [ZEPPELIN-*Jira number*] in PR title, eg. [ZEPPELIN-533] ### How should this be tested? As an example for hive2. #### Properties |name| value| | ------------- |:-------------:| |default.driver| org.apache.hive.jdbc.HiveDriver| |default.url |jdbc:hive2://hive-machine:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2| #### Dependencies |artifact |exclude| | ------------- |:-------------:| |org.apache.hive:hive-jdbc:1.2.1 || |org.apache.hadoop:hadoop-common:2.7.2|| With the above setting used on an older driver for hive2 it shows exception in log, but on the front-end paragraph shows error, and no logs. ``` ERROR [2016-06-19 14:47:46,186] ({pool-2-thread-2} Job.java[run]:182) - Job failed java.lang.NullPointerException at org.apache.thrift.transport.TSocket.open(TSocket.java:168) at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:248) at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37) at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:190) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:163) at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) at java.sql.DriverManager.getConnection(DriverManager.java:571) at java.sql.DriverManager.getConnection(DriverManager.java:187) at org.apache.zeppelin.jdbc.JDBCInterpreter.getConnection(JDBCInterpreter.java:218) at org.apache.zeppelin.jdbc.JDBCInterpreter.getStatement(JDBCInterpreter.java:229) at org.apache.zeppelin.jdbc.JDBCInterpreter.executeSql(JDBCInterpreter.java:288) at org.apache.zeppelin.jdbc.JDBCInterpreter.interpret(JDBCInterpreter.java:393) at org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:94) at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:341) at org.apache.zeppelin.scheduler.Job.run(Job.java:176) at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) ``` ### Screenshots (if appropriate) Before: <img width="1436" alt="screen shot 2016-06-20 at 5 11 59 pm" src="https://cloud.githubusercontent.com/assets/674497/16192988/20ce0312-370a-11e6-967e-281e99dbb18f.png"> After: <img width="1435" alt="screen shot 2016-06-20 at 5 10 26 pm" src="https://cloud.githubusercontent.com/assets/674497/16192984/1121d222-370a-11e6-8da9-43adc80c9c15.png"> ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: Prabhjyot Singh <[email protected]> Closes #1051 from prabhjyotsingh/ZEPPELIN-1036 and squashes the following commits: 595ebc6 [Prabhjyot Singh] have e.getStackTrace() in all cases. 2e8dc0c [Prabhjyot Singh] increase more logs, and return appropriate error to front-end (cherry picked from commit ab5ce62) Signed-off-by: Prabhjyot Singh <[email protected]>
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.
What is this PR for?
In the current implementation JDBC interpret only catches SQLException and ClassNotFoundException. However, there can be a case for example NullPointerException or for that matter anything else can be thrown.
What type of PR is it?
[Improvement]
Todos
What is the Jira issue?
How should this be tested?
As an example for hive2.
Properties
Dependencies
With the above setting used on an older driver for hive2 it shows exception in log, but on the front-end paragraph shows error, and no logs.
Screenshots (if appropriate)
Before:

After:

Questions: