Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.25
    • Fix Version/s: 6.1.26
    • Component/s: Servlet
    • Labels:
      None
    • Environment:
      Windows Server 2008 x64, Java HotSpot(TM) 64-Bit Server VM (14.0-b16, mixed mode)
    • Number of attachments :
      0

      Description

      I have encountered a deadlock with connection timeouts. It appears two locks are being acquired by the two threads in opposite order, which leads to a classic deadlock.

      This deadlock is intermittent, and I am unable to make a consistent test case. It looks like the SelectChannelConnector$ConnectorEndPoint.blockWritable() method is attempting to scheduleIdle a TimeoutTask the same time the Acceptor1 thread is expiring that task (called from Timeout.tick()).

      I've attached the thread dumps below.

      Regards,
      Stephen

      Thread Dumps:

      "831453930@qtp-211225614-8 - Acceptor1 SelectChannelConnector@0.0.0.0:8080" - Thread t@25
      java.lang.Thread.State: BLOCKED on org.mortbay.jetty.nio.SelectChannelConnector$ConnectorEndPoint@5f35a7a1 owned by: 1835465145@qtp-211225614-7
      at org.mortbay.io.nio.SelectChannelEndPoint.updateKey(SelectChannelEndPoint.java:322)
      at org.mortbay.io.nio.SelectChannelEndPoint.close(SelectChannelEndPoint.java:456)
      at org.mortbay.jetty.nio.SelectChannelConnector$ConnectorEndPoint.close(SelectChannelConnector.java:362)
      at org.mortbay.io.nio.SelectChannelEndPoint.idleExpired(SelectChannelEndPoint.java:174)
      at org.mortbay.io.nio.SelectChannelEndPoint$IdleTask.expire(SelectChannelEndPoint.java:489)
      at org.mortbay.thread.Timeout.tick(Timeout.java:137)

      • locked org.mortbay.io.nio.SelectorManager$SelectSet@229e90f9
        at org.mortbay.thread.Timeout.tick(Timeout.java:153)
        at org.mortbay.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:762)
        at org.mortbay.io.nio.SelectorManager.doSelect(SelectorManager.java:192)
        at org.mortbay.jetty.nio.SelectChannelConnector.accept(SelectChannelConnector.java:124)
        at org.mortbay.jetty.AbstractConnector$Acceptor.run(AbstractConnector.java:708)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

      Locked ownable synchronizers:

      • None

      "1835465145@qtp-211225614-7" - Thread t@24
      java.lang.Thread.State: BLOCKED on org.mortbay.io.nio.SelectorManager$SelectSet@229e90f9 owned by: 831453930@qtp-211225614-8 - Acceptor1 SelectChannelConnector@0.0.0.0:8080
      at org.mortbay.io.nio.SelectorManager$SelectSet.scheduleIdle(SelectorManager.java:797)
      at org.mortbay.io.nio.SelectChannelEndPoint.scheduleIdle(SelectChannelEndPoint.java:159)
      at org.mortbay.io.nio.SelectChannelEndPoint.blockWritable(SelectChannelEndPoint.java:293)

      • locked org.mortbay.jetty.nio.SelectChannelConnector$ConnectorEndPoint@5f35a7a1
        at org.mortbay.jetty.AbstractGenerator$Output.blockForOutput(AbstractGenerator.java:544)
        at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:571)
        at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:1010)
        at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:278)
        at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
      • locked java.io.OutputStreamWriter@67770a61
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
        at java.io.PrintWriter.flush(PrintWriter.java:276)
      • locked java.io.OutputStreamWriter@67770a61
        ... (snip)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
        ... (snip)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
        at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

      Locked ownable synchronizers:

      • None

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Greg Wilkins
            Reporter:
            Stephen Allen
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: