-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple server threads hang in java.util.WeakHashMap.get() #194
Comments
I'm seeing the same, but slightly different stack:
Pretty sure I've not seen it in production, but becoming more frequent on my DEV machine. Just now it was in two Quartz Worker Threads that were executing SpringBatch jobs. |
Same problem. on grails 3.2.8 with springloaded-1.2.7.RELEASE part of jvm args
i disable grails quartz plugin in dev environment with hope to resolve problem |
I'm having the same problem with JDK 1.8.141 and springloaded 1.2.5.RELEASE (or 1.2.7.RELEASE), it happens almost every time when I run web app in tomcat8 from Eclipse 4.7 IDE |
happens often in threads named |
Can you elaborate further? Where in https://github.com/apache/groovy/blob/183b8fbf0248a2dceffbba684e50c3c2c060e46c/src/main/org/codehaus/groovy/util/LockableObject.java do you suspect the problem? Groovy's issue tracker does not seem to have a related issue yet (https://issues.apache.org/jira/browse/GROOVY-5249?jql=project%20%3D%20GROOVY%20AND%20text%20~%20LockableObject), but with some more details we could file one. |
I don't think that this related to groovy as the application that I'm dealing with does not use it, unless eclipse injects it during startup debugger for tomcat |
Digging further posting information I find here. In the ReflectiveInterceptor a call is made to get a value from a WeakHashMap that is not synchronized. This causes an endless loop and full CPU We can find information on why that is here: http://www.adam-bien.com/roller/abien/entry/endless_loops_in_unsychronized_weakhashmap The trick is trying to figure out why this is getting concurrently accessed. My stack trace was a little longer than the one provided above and I noticed it went through the Groovy core |
@alexmsu75 I think it is definitely a bug in ReflectiveInterceptor upon further digging. See previous comment and I think it makes sense as to whats going on |
… a ConcurrentWeakHashMap implementation
Fix in PR #202 |
Resolving Issue #194 by swapping out a WeakHashMap for a ConcurrentWeakIdentityHashMap
think this needs closing |
Yay!! |
Have the same problem with Grails 3.2.11 |
I have a Grails project using these depencies:
When running the Grails server in development mode (which has spring-loaded enabled), it often happens that after a few requests to the server, more and more worker threads are hanging at full CPU usage as seen in this jstack trace: spring-loaded-hang-jtrace.txt - notice the threads whose last lines are
(Re-running jstack confirms that each hanging thread is still in the very same location, although I cannot determine at which level of that stack trace looping occurs.)
This happens without changing any source files (i.e. I think it's not related to spring-loaded actually reloading some classes). It also never happens in production mode (where spring-loaded is disabled). In development mode, it consistently happens across 6 dev machines (Mac OS + Linux), in approx. 20% of all dev server starts. Once the dev server makes it beyond some initial requests unharmed (i.e. when all worker threads have been used at least once...?), this problem does not happen.
It looks to me like there is probably at least some interplay between Groovy and spring-loaded that may be causing this. Has anyone else seen this? Can anyone with deeper knowledge of spring-loaded read more from the stack trace than I can? Any help is appreciated - with frequent dev server restarts during my work day, this problem quickly becomes very annoying... :-/
The text was updated successfully, but these errors were encountered: