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

kzhang edited comment on HADOOP-4695 at 11/20/08 10:19 PM:
--------------------------------------------------------------

This bug is caused by a rare event in which jetty called a configured filter 
twice instead of only once. See the following test log.
{noformat}
2008-11-20 14:42:20,427 WARN  http.HttpServer 
(TestGlobalFilter.java:access(83)) - access http://localhost:40643/*
2008-11-20 14:42:20,429 INFO  http.HttpServer 
(TestGlobalFilter.java:doFilter(63)) - filtering /*
2008-11-20 14:42:20,431 WARN  http.HttpServer 
(TestGlobalFilter.java:access(97)) - urlstring=http://localhost:40643/*
java.io.FileNotFoundException: http://localhost:40643/*
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1239)
        at 
org.apache.hadoop.http.TestGlobalFilter.access(TestGlobalFilter.java:89)
        at 
org.apache.hadoop.http.TestGlobalFilter.testServletFilter(TestGlobalFilter.java:137)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)
2008-11-20 14:42:20,434 WARN  http.HttpServer 
(TestGlobalFilter.java:access(83)) - access http://localhost:40643/*
2008-11-20 14:42:20,527 INFO  http.HttpServer 
(TestGlobalFilter.java:doFilter(63)) - filtering /*
2008-11-20 14:42:20,532 INFO  http.HttpServer 
(TestGlobalFilter.java:doFilter(63)) - filtering /*
2008-11-20 14:42:20,533 WARN  http.HttpServer 
(TestGlobalFilter.java:access(97)) - urlstring=http://localhost:40643/*
java.io.FileNotFoundException: http://localhost:40643/*
{noformat}
In the first case, the filter was invoked once for url /*, which is normal. In 
the second case, the filter was invoked twice for the same url, which is an 
abnormal behavior of jetty. I'm attaching a patch where the filter simply 
returns after the first invocation to get around this issue. 

      was (Author: kzhang):
    This bug is caused by a rare event in which jetty called a configured 
filter twice instead of only once. See the following error log.
{noformat}
2008-11-20 14:42:20,427 WARN  http.HttpServer 
(TestGlobalFilter.java:access(83)) - access http://localhost:40643/*
2008-11-20 14:42:20,429 INFO  http.HttpServer 
(TestGlobalFilter.java:doFilter(63)) - filtering /*
2008-11-20 14:42:20,431 WARN  http.HttpServer 
(TestGlobalFilter.java:access(97)) - urlstring=http://localhost:40643/*
java.io.FileNotFoundException: http://localhost:40643/*
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1239)
        at 
org.apache.hadoop.http.TestGlobalFilter.access(TestGlobalFilter.java:89)
        at 
org.apache.hadoop.http.TestGlobalFilter.testServletFilter(TestGlobalFilter.java:137)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)
2008-11-20 14:42:20,434 WARN  http.HttpServer 
(TestGlobalFilter.java:access(83)) - access http://localhost:40643/*
2008-11-20 14:42:20,527 INFO  http.HttpServer 
(TestGlobalFilter.java:doFilter(63)) - filtering /*
2008-11-20 14:42:20,532 INFO  http.HttpServer 
(TestGlobalFilter.java:doFilter(63)) - filtering /*
2008-11-20 14:42:20,533 WARN  http.HttpServer 
(TestGlobalFilter.java:access(97)) - urlstring=http://localhost:40643/*
java.io.FileNotFoundException: http://localhost:40643/*
{noformat}
In the first case, the filter was invoked once for url /*, which is normal. In 
the second case, the filter was invoked twice for the same url, which is an 
abnormal behavior of jetty. I'm attaching a patch where the filter simply 
returns after the first invocation to get around this issue. 
  
> TestGlobalFilter.testServletFilter fails
> ----------------------------------------
>
>                 Key: HADOOP-4695
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4695
>             Project: Hadoop Core
>          Issue Type: Bug
>            Reporter: Tsz Wo (Nicholas), SZE
>
> {noformat}
> junit.framework.AssertionFailedError: expected:<14> but was:<15>
>       at 
> org.apache.hadoop.http.TestGlobalFilter.testServletFilter(TestGlobalFilter.java:150)
> {noformat}
> For more details, see 
> http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/666/ .

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to