[ 
https://issues.apache.org/jira/browse/HDFS-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739006#action_12739006
 ] 

Koji Noguchi commented on HDFS-525:
-----------------------------------

We found this when our hftp access to the namenode started consistently failing.

dfsclient kept on showing
{noformat}
Server returned HTTP response code: 500 for URL:http://...
{noformat}

Namenode log showing 
{noformat}
2009-08-03 22:20:54,411 WARN /: /listPaths/user?ugi=knoguchi,users:
java.lang.IllegalStateException: getState() == BEFORE_XML_DECLARATION
        at org.znerd.xmlenc.XMLOutputter.endDocument(Unknown Source)
        at 
org.apache.hadoop.dfs.ListPathsServlet.doGet(ListPathsServlet.java:163)
        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}

The very first error message on the log was different which led to this Jira.
{noformat}
2009-07-30 03:04:41,582 WARN /:
/listPaths/____?ugi=____,users: 
java.lang.ArrayIndexOutOfBoundsException: 15
        at 
sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:436)
        at 
java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2081)
        at 
java.util.GregorianCalendar.computeFields(GregorianCalendar.java:1996)
        at java.util.Calendar.setTimeInMillis(Calendar.java:1109)
        at java.util.Calendar.setTime(Calendar.java:1075)
        at java.text.SimpleDateFormat.format(SimpleDateFormat.java:876)
        at java.text.SimpleDateFormat.format(SimpleDateFormat.java:869)
        at java.text.DateFormat.format(DateFormat.java:316)
        at 
org.apache.hadoop.dfs.ListPathsServlet.writeInfo(ListPathsServlet.java:59)
        at 
org.apache.hadoop.dfs.ListPathsServlet.doGet(ListPathsServlet.java:154)
        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}

> ListPathsServlet.java uses static SimpleDateFormat that has threading issues
> ----------------------------------------------------------------------------
>
>                 Key: HDFS-525
>                 URL: https://issues.apache.org/jira/browse/HDFS-525
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Suresh Srinivas
>            Assignee: Suresh Srinivas
>
> SimpleDateFormat is not thread safe. Multiple threads accessing the servlet 
> can cause threading issues

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