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

Uma Maheswara Rao G commented on HADOOP-7688:
---------------------------------------------


Hi Nicholas,

 I am not very sure about JETTY internal behavior.
 From the tests what i understood is, when we start the HTTPServer, it is 
trying to start all the contexts.
 For all the contexts it is invoking the Filter inits as well. 

 As per your expectation, if init throws any exception, we need to rethrow it. 
Here caller will be the HTTPServer start method.
 Since JETTY internally handling that exceptions and failing the context 
startups, we may not be able to get that exception out (i could not find the 
way).

 One way of getting the the failure status of contexts is, we can get the 
contexts and check whether all contexts failed. if any of the context startup 
failed we can throw exception.
some thing like below
At the end of HttpServer start method.
  //This snippet is just for understanding the fix
 {code}
   Handler[] handlers = webServer.getHandlers();
    for (int i = 0; i < handlers.length; i++) {
      if(false == handlers[i].isRunning()){
        throw new IOException("Problem starting http server");
      }
    }
  {code}

This may leads to server (NN,JT,DN...) shutdown.

But here concern is, when we consider Jetty as standalone server with multiple 
hosted applications, this solution doesn't fit.
And also consider a case where load on startup is false, this solution may not 
work again.

Please correct me if my understanding is incorrect.

Thanks,
Uma


 
                
> When a servlet filter throws an exception in init(..), the Jetty server 
> failed silently. 
> -----------------------------------------------------------------------------------------
>
>                 Key: HADOOP-7688
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7688
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Uma Maheswara Rao G
>         Attachments: filter-init-exception-test.patch, 
> org.apache.hadoop.http.TestServletFilter-output.txt
>
>
> When a servlet filter throws a ServletException in init(..), the exception is 
> logged by Jetty but not re-throws to the caller.  As a result, the Jetty 
> server failed silently.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to