Hi Romain!
I looked into oracle java and TomEE source files but cannot figure out the root
cause for the deadlock so far.
I added an example of two threads in deadlock situation. It is based on JDK 8 &
TomEE 1.7.1 (but I saw a similar thread deadlock with JDK 7 too).
In URLClassLoaderFirst a ReentrantLock was introduced for TomEE 1.7.X that
seems to be part of the problem, because we never observed a thread deadlock
with TomEE 1.6.X & JDK 7.
Second thread “BpmClusteredScheduler_Worker-2” is waiting for it.
The first thread (“org.junitee.runner.TestRunner”) is waiting at the
synchronized(this) block in java.util.ClassLoader (method checkCerts).
Maybe the example could help to find the cause for the thread deadlock.
If more examples are needed: I have a few more.
Best regards,
Thomas
From: Romain Manni-Bucau [via TomEE & OpenEJB]
[mailto:[email protected]]
Sent: Montag, 30. März 2015 11:09
To: Thomas Schuler
Subject: Re: thread deadlock at URLClassLoaderFirst
https://repository.apache.org/content/groups/snapshots/org/apache/openejb/apache-tomee/1.7.2-SNAPSHOT/
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-03-30 11:03 GMT+02:00 tschuler <[hidden
email]</user/SendEmail.jtp?type=node&node=4674223&i=0>>:
> Hi Romain!
>
> Can you please provide 1.7.2 snapshot url for download?
> I'll give it a try.
>
> Best regards,
> Thomas
>
> From: Romain Manni-Bucau [via TomEE & OpenEJB] [mailto:
> [hidden email]</user/SendEmail.jtp?type=node&node=4674223&i=1>]
> Sent: Freitag, 27. März 2015 16:07
> To: Thomas Schuler
> Subject: Re: thread deadlock at URLClassLoaderFirst
>
> Hi
>
> wonder if it is not fixed on snapshots (if you can try it would be welcomed
> since we'll release 1.7.2 soon)
>
> as a workaround you can prevload the locking classes in a
> ServletContextListener. Should not be the sexiest but the easiest to setup.
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> | Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-03-27 15:59 GMT+01:00 tschuler <[hidden
> email]</user/SendEmail.jtp?type=node&node=4674198&i=0>>:
>
> > Hi!
> >
> > We use TomEE 1.7.1 and get in troubles from time to time because of a
> > thread
> > dead lock resulting in an idle TomEE. It is always the same pattern as
> > shown
> > below - deadlock at
> > org.apache.openejb.util.classloader.URLClassLoaderFirst.
> >
> > Extract from JVisualVM thread dump:
> >
> > Found one Java-level deadlock
> > =============================
> > EjbTimerPool - 2
> > waiting to lock monitor 0x00000000221a3f88 (object 0x00000006c1886f50,
> a
> > org.apache.openejb.util.classloader.URLClassLoaderFirst),
> > which is held by JmsResourceAdapter-worker- - 6
> > JmsResourceAdapter-worker- - 6
> > waiting for ownable synchronizer 0x00000006c13b0cc0, (a
> > java.util.concurrent.locks.ReentrantLock$NonfairSync),
> > which is held by JmsResourceAdapter-worker- - 7
> > JmsResourceAdapter-worker- - 7
> > waiting to lock monitor 0x00000000221a3f88 (object 0x00000006c1886f50,
> a
> > org.apache.openejb.util.classloader.URLClassLoaderFirst),
> > which is held by JmsResourceAdapter-worker- - 6
> >
> > Is there a way to get rid off the potential thread deadlock?
> >
> > Best regards,
> > Thomas
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tomee-openejb.979440.n4.nabble.com/thread-deadlock-at-URLClassLoaderFirst-tp4674197.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://tomee-openejb.979440.n4.nabble.com/thread-deadlock-at-URLClassLoaderFirst-tp4674197p4674198.html
> To unsubscribe from thread deadlock at URLClassLoaderFirst, click here<
> >.
> NAML<
> http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/thread-deadlock-at-URLClassLoaderFirst-tp4674197p4674222.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
________________________________
If you reply to this email, your message will be added to the discussion below:
http://tomee-openejb.979440.n4.nabble.com/thread-deadlock-at-URLClassLoaderFirst-tp4674197p4674223.html
To unsubscribe from thread deadlock at URLClassLoaderFirst, click
here<http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4674197&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NzQxOTd8LTE4NTIyNTQ0OTI=>.
NAML<http://tomee-openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
threaddump_restricted.tdump (13K)
<http://tomee-openejb.979440.n4.nabble.com/attachment/4674247/0/threaddump_restricted.tdump>
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/thread-deadlock-at-URLClassLoaderFirst-tp4674197p4674247.html
Sent from the TomEE Users mailing list archive at Nabble.com.