Josh Elser created CALCITE-962:
----------------------------------
Summary: Server-side exception (stack trace) not propagated in
JdbcMeta.propagate
Key: CALCITE-962
URL: https://issues.apache.org/jira/browse/CALCITE-962
Project: Calcite
Issue Type: Bug
Components: avatica
Affects Versions: 1.5.0
Reporter: Josh Elser
Assignee: Josh Elser
Fix For: next
Noticed the following in some automated tests against Phoenix:
{noformat}
java.lang.RuntimeException: Encountered exception in sub plan [0] execution.
at org.apache.calcite.avatica.jdbc.JdbcMeta.propagate(JdbcMeta.java:645)
at
org.apache.calcite.avatica.jdbc.JdbcMeta.prepareAndExecute(JdbcMeta.java:709)
at org.apache.calcite.avatica.remote.LocalService.apply(LocalService.java:179)
at
org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1049)
at
org.apache.calcite.avatica.remote.Service$PrepareAndExecuteRequest.accept(Service.java:1023)
at
org.apache.calcite.avatica.remote.AbstractHandler.apply(AbstractHandler.java:100)
at org.apache.calcite.avatica.remote.JsonHandler.apply(JsonHandler.java:43)
at
org.apache.calcite.avatica.server.AvaticaHandler.handle(AvaticaHandler.java:68)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
{noformat}
The good part, we got this exception from the server on the client! Oddly, we
didn't get an actual exception from Phoenix. It looks like we happened to drop
that context.
{code}
private RuntimeException propagate(Throwable e) {
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
} else if (e instanceof Error) {
throw (Error) e;
} else {
throw new RuntimeException(e.getMessage());
}
}
{code}
The else branch happened to drop the context from the cause. We want to be sure
to propagate this back to clients.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)