You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Koji Noguchi (JIRA)" <ji...@apache.org> on 2008/10/28 00:59:44 UTC

[jira] Created: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

In fsck, HttpServletResponse sendError fails with IllegalStateException
-----------------------------------------------------------------------

                 Key: HADOOP-4530
                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
             Project: Hadoop Core
          Issue Type: Bug
          Components: dfs
    Affects Versions: 0.18.1
            Reporter: Koji Noguchi


When looking at HADOOP-4526, I tried using sendError at line:53.

{code:title=FsckServlet.java|borderStyle=solid}                                _
     49     } catch (IOException ie) {
     50       StringUtils.stringifyException(ie);
     51       LOG.warn(ie);
     52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
     53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
     54       throw ie;
     55     }
{code}

However, it always failed with 
{noformat}
2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
java.lang.IllegalStateException: Committed
  at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
  at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
  at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
  at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
  at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
  at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
  at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
  at org.mortbay.http.HttpServer.service(HttpServer.java:954)
  at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
  at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
  at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
  at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
  at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
  at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
{noformat}

And client wasn't seeing the error.

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


[jira] Updated: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HADOOP-4530:
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.20.0
     Hadoop Flags: [Reviewed]
           Status: Resolved  (was: Patch Available)

I just committed this.

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>             Fix For: 0.20.0
>
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch, fsckError3.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643176#action_12643176 ] 

Steve Loughran commented on HADOOP-4530:
----------------------------------------

Maybe not closed the stream, but certain enough of the HTTP response had already gone back (200 status code &c) that trying to set an error code in the respose

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645058#action_12645058 ] 

Konstantin Shvachko commented on HADOOP-4530:
---------------------------------------------

The test is good.
Could you please remove import of StringUtils and the LOG member in FsckServlet. Those are not used anymore with your changes.
Sorry missed it yesterday.

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644827#action_12644827 ] 

Konstantin Shvachko commented on HADOOP-4530:
---------------------------------------------

# Comment in DFSck.run() talking about errCode should be updated or removed.
# {{NamenodeFsck.FAILURE_STATUS = "FAILED";}} instead of {{"is FAILED"}}.
# TestFsck.java
#- Redundant import java.nio.ByteBuffer;
#- {{assertTrue(-1 != outStr.indexOf(...));}} can be uniformly replaced with {{assertTrue(outStr.contains(...));}}
#- We do not have a test case that checks the -1 error code. Should we?

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Updated: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HADOOP-4530:
----------------------------------

    Attachment: fsckError.patch

This patch catches any exception during fsck, logs it, and sends an error message to the client side. The client returns -1 on errors.

Koji, could you please try the attached patch to see if you like the change? I will work on junit tests.

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645340#action_12645340 ] 

Konstantin Shvachko commented on HADOOP-4530:
---------------------------------------------

+1

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch, fsckError3.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Updated: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HADOOP-4530:
----------------------------------

    Attachment: fsckError2.patch

The patch incorporates Konstantin's comments. Thank Konstantin for helping me figure out the way to test the failure case.

In addition, it makes sure that the DFS cluster gets shutdown in case of a failure in the testFsckCorrupt.

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Updated: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HADOOP-4530:
----------------------------------

    Attachment: fsckError3.patch

Thanks Konstantin! Here is the one that removed the not needed field Log & import.

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch, fsckError3.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644832#action_12644832 ] 

Hairong Kuang commented on HADOOP-4530:
---------------------------------------

Yes, we should have a test case that checks -1 error code. But I am not able to figure out a way to generate fsck errors. Do you have any idea?

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645515#action_12645515 ] 

Hudson commented on HADOOP-4530:
--------------------------------

Integrated in Hadoop-trunk #653 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/653/])
    . In fsck, HttpServletResponse sendError fails with IllegalStateException. Contributed by Hairong Kuang.


> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>             Fix For: 0.20.0
>
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch, fsckError3.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Assigned: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang reassigned HADOOP-4530:
-------------------------------------

    Assignee: Hairong Kuang

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Updated: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HADOOP-4530:
----------------------------------

    Status: Patch Available  (was: Open)

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Updated: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hairong Kuang updated HADOOP-4530:
----------------------------------

    Attachment: fsckError1.patch

Attached patch incorporates Koji's comments.
1. fsck returns 0 if the file system is HEALTHY or the input path does not exist; return 1 when the file system is CORRUPT. These are the same as before;
2. fsck returns -1 otherwise.

The patch also only scans last line for the hint of return code. Scanning string for return code is very error prone. So I declared those strings indicating return code as constants. 

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hairong Kuang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643105#action_12643105 ] 

Hairong Kuang commented on HADOOP-4530:
---------------------------------------

This is because NameNodeFsck already closed the response stream. Errror handling should be done in NamenodeFsck not in FsckServlet. 

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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


[jira] Commented: (HADOOP-4530) In fsck, HttpServletResponse sendError fails with IllegalStateException

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645178#action_12645178 ] 

Hadoop QA commented on HADOOP-4530:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12393327/fsckError3.patch
  against trunk revision 711482.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 5 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs warnings.

    +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3532/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3532/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3532/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3532/console

This message is automatically generated.

> In fsck, HttpServletResponse sendError fails with IllegalStateException
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-4530
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4530
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.1
>            Reporter: Koji Noguchi
>            Assignee: Hairong Kuang
>         Attachments: fsckError.patch, fsckError1.patch, fsckError2.patch, fsckError3.patch
>
>
> When looking at HADOOP-4526, I tried using sendError at line:53.
> {code:title=FsckServlet.java|borderStyle=solid}                                _
>      49     } catch (IOException ie) {
>      50       StringUtils.stringifyException(ie);
>      51       LOG.warn(ie);
>      52       String errMsg = "Fsck on path " + pmap.get("path") + " failed.";
>      53       response.sendError(HttpServletResponse.SC_GONE, errMsg);
>      54       throw ie;
>      55     }
> {code}
> However, it always failed with 
> {noformat}
> 2008-10-27 22:39:07,359 WARN /: /fsck?path=%2Fuser:
> java.lang.IllegalStateException: Committed
>   at org.mortbay.jetty.servlet.ServletHttpResponse.resetBuffer(ServletHttpResponse.java:212)
>   at org.mortbay.jetty.servlet.ServletHttpResponse.sendError(ServletHttpResponse.java:375)
>   at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:54)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>   at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
>   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>   at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
>   at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>   at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>   at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
>   at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
>   at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
>   at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
>   at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>   at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> {noformat}
> And client wasn't seeing the error.

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