You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Jaideep Dhok (JIRA)" <ji...@apache.org> on 2015/02/25 07:17:04 UTC
[jira] [Commented] (LENS-300) NPE when session is gone but the
query launched by the session is still getting submitted
[ https://issues.apache.org/jira/browse/LENS-300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14336073#comment-14336073 ]
Jaideep Dhok commented on LENS-300:
-----------------------------------
LensService.getSession should do a null check.
{code}
public LensSessionImpl getSession(LensSessionHandle sessionHandle) {
try {
return ((LensSessionImpl) getSessionManager().getSession(getHiveSessionHandle(sessionHandle)));
} catch (HiveSQLException exc) {
LOG.warn("Session " + sessionHandle.getPublicId() + " not found", exc);
// throw resource gone exception (410)
throw new ClientErrorException("Session " + sessionHandle.getPublicId() + " is invalid " + sessionHandle, 410);
}
}
{code}
Same error which is thrown in catch block for HiveSQLException can be thrown here as well.
> NPE when session is gone but the query launched by the session is still getting submitted
> -----------------------------------------------------------------------------------------
>
> Key: LENS-300
> URL: https://issues.apache.org/jira/browse/LENS-300
> Project: Apache Lens
> Issue Type: Bug
> Reporter: Arshad Matin
>
> Scenario : If session gets closed while the query is still getting submitted then it will throw NPE
> {noformat}
> 09 Feb 2015 19:22:15,934 [QuerySubmitter] INFO org.apache.lens.driver.hive.HiveDriver - New hive session for user: test, lens session: 18166fa3-a0e1-4530-9f99-80a0aaef9adf session handle: 994c099a-6a3c-49c3-a25f-f42f6db44f2c
> 09 Feb 2015 19:22:15,934 [QuerySubmitter] INFO org.apache.lens.server.query.QueryExecutionServiceImpl - New driver event by driver org.apache.lens.driver.hive.HiveDriver@77424e9
> 09 Feb 2015 19:22:15,934 [QuerySubmitter] WARN org.apache.lens.server.query.QueryExecutionServiceImpl - Lens session went away for sessionid:18166fa3-a0e1-4530-9f99-80a0aaef9adf
> 09 Feb 2015 19:22:15,968 [QuerySubmitter] INFO org.apache.lens.driver.hive.HiveDriver - No hive operation available for 91c18966-7fe4-47de-b0a7-3519df1e2a27
> 09 Feb 2015 19:22:15,968 [QuerySubmitter] ERROR org.apache.lens.server.query.QueryExecutionServiceImpl - Error launching query 91c18966-7fe4-47de-b0a7-3519df1e2a27
> org.apache.lens.api.LensException: Error executing async query
> at org.apache.lens.driver.hive.HiveDriver.executeAsync(HiveDriver.java:443)
> at org.apache.lens.server.query.QueryExecutionServiceImpl$QuerySubmitter.run(QueryExecutionServiceImpl.java:483)
> at java.lang.Thread.run(Thread.java:701)
> Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: SemanticException java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.lens.lib.query.CSVSerde
> at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.checkStatus(ThriftCLIServiceClient.java:52)
> at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatementInternal(ThriftCLIServiceClient.java:151)
> at org.apache.hive.service.cli.thrift.ThriftCLIServiceClient.executeStatementAsync(ThriftCLIServiceClient.java:139)
> at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:622)
> at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invokeInternal(RetryingThriftCLIServiceClient.java:301)
> at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient.invoke(RetryingThriftCLIServiceClient.java:329)
> at com.sun.proxy.$Proxy56.executeStatementAsync(Unknown Source)
> at org.apache.hive.service.cli.thrift.RetryingThriftCLIServiceClient$CLIServiceClientWrapper.executeStatementAsync(RetryingThriftCLIServiceClient.java:118)
> at org.apache.lens.driver.hive.HiveDriver.executeAsync(HiveDriver.java:434)
> ... 2 more
> 09 Feb 2015 19:22:15,969 [QuerySubmitter] ERROR org.apache.lens.server.query.QueryExecutionServiceImpl - Error in query submitter
> java.lang.NullPointerException
> at org.apache.lens.server.LensService.getHiveSessionHandle(LensService.java:349)
> at org.apache.lens.server.LensService.getSession(LensService.java:245)
> at org.apache.lens.server.LensService.release(LensService.java:298)
> at org.apache.lens.server.query.QueryExecutionServiceImpl$QuerySubmitter.run(QueryExecutionServiceImpl.java:490)
> at java.lang.Thread.run(Thread.java:701)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)