powered by Jive Software

Openfire(http-bind) deadlock

I rebuild openfire for use java.util.concurrent ThreadPool for jetty. (jetty BoundedThreadPool not close inactive threads)

JVM args: -server -Xss96k -Xms1536m -Xmx1536m -Xmn128m -XX:ParallelGCThreads=2

Thread dump, deadlock part:

Found one Java-level deadlock:

=============================

“pool-openfire4855”:

waiting to lock monitor 0x4fa93e78 (object 0x5a2d3240, a org.jivesoftware.openfire.http.HttpSession),

which is held by “pool-9-thread-25”

“pool-9-thread-25”:

waiting to lock monitor 0x09374e98 (object 0x5a2d32f0, a org.jivesoftware.openfire.http.HttpSession$HttpVirtualConnection),

which is held by “pool-8-thread-4282”

“pool-8-thread-4282”:

waiting to lock monitor 0x4fa93e78 (object 0x5a2d3240, a org.jivesoftware.openfire.http.HttpSession),

which is held by “pool-9-thread-25”

Java stack information for the threads listed above:

===================================================

“pool-openfire4855”:

at org.jivesoftware.openfire.http.HttpSession.getLastActivity(HttpSession.java:313 )

  • waiting to lock <0x5a2d3240> (a org.jivesoftware.openfire.http.HttpSession)

at org.jivesoftware.openfire.http.HttpSessionManager$HttpSessionReaper.run(HttpSes sionManager.java:291)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 885)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

at java.lang.Thread.run(Thread.java:619)

“pool-9-thread-25”:

at org.jivesoftware.openfire.net.VirtualConnection.close(VirtualConnection.java:15 0)

  • waiting to lock <0x5a2d32f0> (a org.jivesoftware.openfire.http.HttpSession$HttpVirtualConnection)

at org.jivesoftware.openfire.http.HttpSession.close(HttpSession.java:131)

at org.jivesoftware.openfire.http.HttpBindServlet.sendError(HttpBindServlet.java:1 86)

at org.jivesoftware.openfire.http.HttpBindServlet.isContinuation(HttpBindServlet.j ava:165)

  • locked <0x5a2d3240> (a org.jivesoftware.openfire.http.HttpSession)

at org.jivesoftware.openfire.http.HttpBindServlet.doPost(HttpBindServlet.java:114)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollect ion.java:211)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

at org.mortbay.jetty.Server.handle(Server.java:324)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:375)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)

at org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(SelectChanne lConnector.java:504)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 885)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

at java.lang.Thread.run(Thread.java:619)

“pool-8-thread-4282”:

at org.jivesoftware.openfire.http.HttpSession.closeConnection(HttpSession.java:637 )

  • waiting to lock <0x5a2d3240> (a org.jivesoftware.openfire.http.HttpSession)

at org.jivesoftware.openfire.http.HttpSession.access$200(HttpSession.java:43)

at org.jivesoftware.openfire.http.HttpSession$HttpVirtualConnection.closeVirtualCo nnection(HttpSession.java:708)

at org.jivesoftware.openfire.net.VirtualConnection.close(VirtualConnection.java:15 5)

  • locked <0x5a2d32f0> (a org.jivesoftware.openfire.http.HttpSession$HttpVirtualConnection)

at org.jivesoftware.openfire.http.HttpSession.close(HttpSession.java:131)

at org.jivesoftware.openfire.handler.IQAuthHandler.login(IQAuthHandler.java:220)

at org.jivesoftware.openfire.handler.IQAuthHandler.handleIQ(IQAuthHandler.java:145 )

at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:48)

at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:309)

at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:101)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:67)

at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:99 )

at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:60 )

at org.jivesoftware.openfire.http.HttpSession.sendPendingPackets(HttpSession.java: 430)

  • locked <0x5a2e1240> (a java.util.LinkedList)

at org.jivesoftware.openfire.http.HttpSessionManager$HttpPacketSender.run(HttpSess ionManager.java:311)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 885)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

at java.lang.Thread.run(Thread.java:619)

Found 1 deadlock.

Any solution for this issue?