[
https://issues.apache.org/jira/browse/DRILL-5874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16210329#comment-16210329
]
ASF GitHub Bot commented on DRILL-5874:
---------------------------------------
Github user sohami commented on a diff in the pull request:
https://github.com/apache/drill/pull/993#discussion_r145566366
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebSessionResources.java
---
@@ -68,16 +68,19 @@ public SocketAddress getRemoteAddress() {
@Override
public void close() {
-
try {
AutoCloseables.close(webUserSession, allocator);
} catch (Exception ex) {
logger.error("Failure while closing the session resources", ex);
}
- // Set the close future associated with this session.
+ // Notify all the listeners of this closeFuture for failure events so
that listeners can do cleanup related to this
+ // WebSession. This will be called after every query execution by
AnonymousWebUserConnection::cleanupSession and
--- End diff --
From my understanding session is tied to a cookie not a connection. In case
of anonymous session, we call close after completion of each query. But for
authenticated session the close will be called when HttpSession is invalidated
which is during logout or session timeout.
> NPE in AnonWebUserConnection.cleanupSession()
> ---------------------------------------------
>
> Key: DRILL-5874
> URL: https://issues.apache.org/jira/browse/DRILL-5874
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.12.0
> Reporter: Paul Rogers
> Assignee: Sorabh Hamirwasia
> Fix For: 1.12.0
>
>
> When debugging another issue, I tried to use the Web UI to run the example
> query:
> {code}
> SELECT * FROM cp.`employee.json` LIMIT 20
> {code}
> The query failed with this error:
> {noformat}
> Query Failed: An Error Occurred
> java.lang.NullPointerException
> {noformat}
> No stack trace was provided in the log, even at DEBUG level.
> Debugging, the problem appears to be deep inside
> {{AnonWebUserConnection.cleanupSession()}}:
> {code}
> package io.netty.channel;
> public class DefaultChannelPromise ...
> protected EventExecutor executor() {
> EventExecutor e = super.executor();
> if (e == null) {
> return channel().eventLoop();
> } else {
> return e;
> }
> }
> {code}
> In the above, {{channel()}} is null. the {{channel}} field is also null.
> This may indicate that some part of the Web UI was not set up correctly. This
> is a recent change, as this code worked several days ago.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)