Re: GroovyClassLoader deadlock in Groovy 2.4.6?

2016-06-27 Thread John Wagenleitner
Having the full stack trace of one blocked thread and the blocking thread
would help.  Also, would be helpful to see how the template engine is used
in code if possible.
On Jun 20, 2016 7:48 PM, "lp_forum"  wrote:

Hi,

I have a very simple single page app using Java 7 + Spring Boot 1.3.3 +
Groovy Template (using Groovy 2.4.6).

The app starts hanging after it starts and gets hit for a while (it can be
as short as just few hours).

The thread dump shows that hundreds of threads are waiting to lock a
java.util.HashMap, like this:

"http-nio-9044-exec-294" daemon prio=10 tid=0x7f54d0b68000 nid=0x7632
waiting for monitor entry [0x7f54c99d6000]
   java.lang.Thread.State: BLOCKED (on object monitor)
at
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:266)
- waiting to lock <0x000786748cd8> (a java.util.HashMap)
at
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:254)
at
groovy.text.markup.MarkupTemplateEngine$TemplateGroovyClassLoader.parseClass(MarkupTemplateEngine.java:252)

This seems similar to GROOVY-4127, but that issue was fixed a long time ago.

If anyone needs, I can send the full thread dump.

Thanks,
Su



--
View this message in context:
http://groovy.329449.n5.nabble.com/GroovyClassLoader-deadlock-in-Groovy-2-4-6-tp5733397.html
Sent from the Groovy Dev mailing list archive at Nabble.com.


Re: GroovyClassLoader deadlock in Groovy 2.4.6?

2016-06-21 Thread Jochen Theodorou

On 21.06.2016 04:48, lp_forum wrote:

Hi,

I have a very simple single page app using Java 7 + Spring Boot 1.3.3 +
Groovy Template (using Groovy 2.4.6).

The app starts hanging after it starts and gets hit for a while (it can be
as short as just few hours).

The thread dump shows that hundreds of threads are waiting to lock a
java.util.HashMap, like this:

"http-nio-9044-exec-294" daemon prio=10 tid=0x7f54d0b68000 nid=0x7632
waiting for monitor entry [0x7f54c99d6000]
java.lang.Thread.State: BLOCKED (on object monitor)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:266)
- waiting to lock <0x000786748cd8> (a java.util.HashMap)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:254)
at
groovy.text.markup.MarkupTemplateEngine$TemplateGroovyClassLoader.parseClass(MarkupTemplateEngine.java:252)



we donĀ“t need the full dump, but we would need to know the deadlock 
structure. In the most simple case one thread has a lock and waits for 
another, while another thread has that lock and waits for the lock the 
first thread has. If we know how that cycle comes into existence, then 
we can do something about it. Do you think you can provide that?


bye Jochen