]
Mark Torres commented on JBSEAM-4697:
-------------------------------------
Thanks for a fast turnaround. It is a weird bug indeed. Similar to the author of the blog
above, I didnt think unsynchronized access could cause an infinite loop.
I did see that UserTokens is session scoped, it still could be accessed by multiple
concurrent requests though.
SubscriptionRegistry.subscribe can cause thread to freeze
---------------------------------------------------------
Key: JBSEAM-4697
URL:
https://jira.jboss.org/browse/JBSEAM-4697
Project: Seam
Issue Type: Bug
Components: Remoting
Affects Versions: 2.1.2.GA
Environment: ubuntu hardy, j2se 64-bit build 1.6.0_17-b04, jboss 4.2.3
Reporter: Mark Torres
Assignee: Shane Bryzak
Fix For: 2.2.1.CR3
We ran into an issue where we got really high cpu usage on one instance of our
application. Upon inspection in yourkit profiler, we found that the following threads
we're consuming all the cpu(see stacktraces below).
Upon googling, we saw several posts where concurrent access to hashmap can cause it to
enter into an infinite loop.
http://lightbody.net/blog/2005/07/hashmapget_can_cause_an_infini.html
Subscription registry is using a HashMap and HashSet(for user tokens) below the covers,
so I think this issue can be fixed by just using ConcurrentHashMap and ConcurrentHashSet
respectively.
Thread: ajp-172.17.8.20-8209-2 : priority:5, demon:true, threadId:228,
threadState:RUNNABLE, lockName:null
java.util.HashMap.put(HashMap.java:405)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
Thread: ajp-172.17.8.20-8209-6 : priority:5, demon:true, threadId:279,
threadState:RUNNABLE, lockName:null
java.util.HashMap.put(HashMap.java:405)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
Thread: ajp-172.17.8.20-8209-10 : priority:5, demon:true, threadId:5336,
threadState:RUNNABLE, lockName:null
java.util.HashMap.put(HashMap.java:405)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
Thread: ajp-172.17.8.20-8209-18 : priority:5, demon:true, threadId:10515,
threadState:RUNNABLE, lockName:null
java.util.HashMap.transfer(HashMap.java:527)
java.util.HashMap.resize(HashMap.java:506)
java.util.HashMap.addEntry(HashMap.java:810)
java.util.HashMap.put(HashMap.java:416)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
Thread: ajp-172.17.8.20-8209-21 : priority:5, demon:true, threadId:10518,
threadState:RUNNABLE, lockName:null
java.util.HashMap.put(HashMap.java:405)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
Thread: ajp-172.17.8.20-8209-26 : priority:5, demon:true, threadId:10523,
threadState:RUNNABLE, lockName:null
java.util.HashMap.put(HashMap.java:405)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
Thread: ajp-172.17.8.20-8209-29 : priority:5, demon:true, threadId:16450,
threadState:RUNNABLE, lockName:null
java.util.HashMap.put(HashMap.java:405)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
Thread: ajp-172.17.8.20-8209-35 : priority:5, demon:true, threadId:26542,
threadState:RUNNABLE, lockName:null
java.util.HashMap.put(HashMap.java:405)
org.jboss.seam.remoting.messaging.SubscriptionRegistry.subscribe(SubscriptionRegistry.java:121)
org.jboss.seam.remoting.messaging.SubscriptionRequest.subscribe(SubscriptionRequest.java:22)
org.jboss.seam.remoting.SubscriptionHandler.handle(SubscriptionHandler.java:68)
org.jboss.seam.remoting.Remoting.getResource(Remoting.java:111)
org.jboss.seam.servlet.SeamResourceServlet.service(SeamResourceServlet.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: