[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Deadlock in JDBCSessionManager / JDBCSessionIdManager (Jetty 8)

Hello,

Recently we encountered a deadlock using the Jetty 8 JDBC session management classes:

Found one Java-level deadlock:
=============================
"JETTY-60":
 waiting to lock monitor 0x0000000000b921f8 (object 0x00000006d58ef0e0, a java.util.HashSet),
 which is held by "JETTY-58"
"JETTY-58":
 waiting to lock monitor 0x00007faac8028588 (object 0x00000006d58eecc8, a org.eclipse.jetty.server.session.JDBCSessionManager),
 which is held by "JETTY-60"

Java stack information for the threads listed above:
===================================================
"JETTY-60":
ÂÂÂ at org.eclipse.jetty.server.session.JDBCSessionIdManager.removeSession(JDBCSessionIdManager.java:409)
ÂÂÂ - waiting to lock <0x00000006d58ef0e0> (a java.util.HashSet)
ÂÂÂ at org.eclipse.jetty.server.session.JDBCSessionManager.loadSession(JDBCSessionManager.java:874)
ÂÂÂ at org.eclipse.jetty.server.session.JDBCSessionManager.getSession(JDBCSessionManager.java:482)
ÂÂÂ - locked <0x00000006d58eecc8> (a org.eclipse.jetty.server.session.JDBCSessionManager)
ÂÂÂ at org.eclipse.jetty.server.session.JDBCSessionManager.getSession(JDBCSessionManager.java:75)
ÂÂÂ at org.eclipse.jetty.server.session.AbstractSessionManager.getHttpSession(AbstractSessionManager.java:312)
ÂÂÂ at org.eclipse.jetty.server.session.SessionHandler.checkRequestedSessionId(SessionHandler.java:279)
ÂÂÂ at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:159)
ÂÂÂ at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
ÂÂÂ at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
ÂÂÂ at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
ÂÂÂ at com.codahale.metrics.jetty8.InstrumentedHandler.handle(InstrumentedHandler.java:192)
ÂÂÂ at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
ÂÂÂ at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
ÂÂÂ at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
ÂÂÂ at org.eclipse.jetty.server.Server.handle(Server.java:370)
ÂÂÂ at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
ÂÂÂ at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
ÂÂÂ at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
ÂÂÂ at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
ÂÂÂ at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
ÂÂÂ at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
ÂÂÂ at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196)
ÂÂÂ at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
ÂÂÂ at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
ÂÂÂ at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
ÂÂÂ at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
ÂÂÂ at java.lang.Thread.run(Thread.java:745)
"JETTY-58":
ÂÂÂ at org.eclipse.jetty.server.session.JDBCSessionManager.invalidateSession(JDBCSessionManager.java:625)
ÂÂÂ - waiting to lock <0x00000006d58eecc8> (a org.eclipse.jetty.server.session.JDBCSessionManager)
ÂÂÂ at org.eclipse.jetty.server.session.JDBCSessionIdManager.invalidateAll(JDBCSessionIdManager.java:503)
ÂÂÂ - locked <0x00000006d58ef0e0> (a java.util.HashSet)
ÂÂÂ at org.eclipse.jetty.server.session.JDBCSessionManager.removeSession(JDBCSessionManager.java:733)
ÂÂÂ at org.eclipse.jetty.server.session.AbstractSession.invalidate(AbstractSession.java:335)
ÂÂÂ at org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler.logout(SecurityContextLogoutHandler.java:63)
ÂÂÂ at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:97)
ÂÂÂ at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
ÂÂÂ at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
ÂÂÂ at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
ÂÂÂ at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
ÂÂÂ at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
ÂÂÂ at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
ÂÂÂ at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
ÂÂÂ at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
ÂÂÂ at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
ÂÂÂ at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
ÂÂÂ at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
ÂÂÂ at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
ÂÂÂ at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
ÂÂÂ at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
ÂÂÂ at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
ÂÂÂ at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
ÂÂÂ at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
ÂÂÂ at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
ÂÂÂ at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
ÂÂÂ at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
ÂÂÂ at com.codahale.metrics.jetty8.InstrumentedHandler.handle(InstrumentedHandler.java:192)
ÂÂÂ at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
ÂÂÂ at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
ÂÂÂ at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
ÂÂÂ at org.eclipse.jetty.server.Server.handle(Server.java:370)
ÂÂÂ at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
ÂÂÂ at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
ÂÂÂ at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
ÂÂÂ at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
ÂÂÂ at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
ÂÂÂ at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
ÂÂÂ at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196)
ÂÂÂ at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
ÂÂÂ at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
ÂÂÂ at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
ÂÂÂ at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
ÂÂÂ at java.lang.Thread.run(Thread.java:745)

Found 1 deadlock.

Jetty version is 8.1.15.v20140411. Database is MySQL 5.6, Connector/J 5.1.24.

$ uname -a
Linux <hostname> 3.2.0-74-virtual #109-Ubuntu SMP Tue Dec 9 17:04:48 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ /usr/lib/jvm/java-7-oracle/bin/java -version
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)


I understand that jetty 8 is EOL. Has this issue been resolved in jetty 9?

If you need more information from me just let me know.

Thanks,
Colin