[ 
https://issues.apache.org/jira/browse/DRILL-5874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16210331#comment-16210331
 ] 

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_r145568772
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/WebUserConnection.java
 ---
    @@ -124,6 +124,13 @@ public void sendData(RpcOutcomeListener<Ack> listener, 
QueryWritableBatch result
         }
       }
     
    +  /**
    +   * Returns a DefaultChannelPromise which doesn't have reference to any 
actual channel but has an EventExecutor
    +   * associated with it. In this case we use EventExecutor out of 
BitServer EventLoopGroup. Since there is no actual
    +   * connection established using this class, hence the close event will 
never be fired by underlying layer and close
    +   * future is set only when the WebSessionResources are closed.
    --- End diff --
    
    The intent of putting this comment here was just as an FYI how the 
underlying CloseFuture is created which is returned by this function and 
stressting the fact that it doesn't have any actual physical connection 
associated with it.
    
    WebUserConnection acts like an adapter between HttpSession and connection 
which Foreman expects with each submitted request. For authenticated user this 
adapter is used to get UserSession object which stores all the updated Drill 
session options changed over the time. 
    
    For anonymous user this adapter is created fresh with each request. But as 
discussed in person I will make a change so that we can maintain session for 
anonymous user and have similar behavior like authenticated user. And when the 
HttpSession for unauthenticated user time's out then it will do clean up of all 
the web resources related to that session.


> 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)

Reply via email to