|
Re: [Teneo] Waiting Teneo Threads Prevent JVM From Shutting Down [message #1696266 is a reply to message #1696144] |
Sun, 24 May 2015 19:55 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Timo,
I recently encountered a similar issue in another project I do (outside of EMF). These threads should be changed to
daemon threads. At least I see now that I need to make this change for Teneo. But I checked and the EMF
org.eclipse.emf.common.util.CommonUtil$1ReferenceClearingQueuePollingThread is already a deamon. So I am surprised that
it also prevents the jvm from exiting.
Can you enter an issue for Teneo? I can easily make this change for the Teneo threads.
Which EMF/Teneoe versions are you using?
gr. Martin
On 22-05-15 13:17, Timo Rohrberg wrote:
> Hello everybody,
>
> in my OSGi/Equinox based application I have the following problematic situation: When shutting down the OSGi system via
> "shutdown" command on the OSGi console, the OSGi system terminates, but the JVM process remains running forever. A
> thread dump shows, that there are still three threads running or waiting respectively which obviously prevent the JVM
> from terminating:
>
>
> Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode):
>
> "DestroyJavaVM" #42 prio=5 os_prio=0 tid=0x000000005f614800 nid=0xdac waiting on condition [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "teneoHibernateVersionMapPurging-41" #41 prio=5 os_prio=0 tid=0x000000005f612800 nid=0x26c waiting on condition
> [0x000000006260e000]
> java.lang.Thread.State: TIMED_WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> - parking to wait for <0x000000008301b4f8> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
> at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
> at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
> at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
> Locked ownable synchronizers:
> - None
>
> "teneoHibernateIdMapPurging-40" #40 prio=5 os_prio=0 tid=0x000000005f611800 nid=0x1b9c waiting on condition
> [0x000000006244e000]
> java.lang.Thread.State: TIMED_WAITING (parking)
> at sun.misc.Unsafe.park(Native Method)
> - parking to wait for <0x000000008301b0c0> (a
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
> at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
> at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
> at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
> at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
> at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
> Locked ownable synchronizers:
> - None
>
> "EMF Reference Cleaner" #20 daemon prio=5 os_prio=0 tid=0x000000005b1fe800 nid=0x1910 in Object.wait() [0x000000005c75f000]
> java.lang.Thread.State: WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
> - locked <0x00000000812f2d60> (a java.lang.ref.ReferenceQueue$Lock)
> at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
> at org.eclipse.emf.common.util.CommonUtil$1ReferenceClearingQueuePollingThread.run(CommonUtil.java:70)
>
> Locked ownable synchronizers:
> - None
>
> "Service Thread" #12 daemon prio=9 os_prio=0 tid=0x0000000058d8b800 nid=0x1a64 runnable [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "C1 CompilerThread2" #11 daemon prio=9 os_prio=2 tid=0x0000000058d6b000 nid=0x120c waiting on condition
> [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "C2 CompilerThread1" #10 daemon prio=9 os_prio=2 tid=0x0000000058d26000 nid=0x1378 waiting on condition
> [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "C2 CompilerThread0" #9 daemon prio=9 os_prio=2 tid=0x0000000058d1e800 nid=0x16bc waiting on condition [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "JDWP Command Reader" #8 daemon prio=10 os_prio=0 tid=0x0000000058d12800 nid=0x1640 runnable [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "JDWP Event Helper Thread" #7 daemon prio=10 os_prio=0 tid=0x0000000058d0f800 nid=0x1490 runnable [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "JDWP Transport Listener: dt_socket" #6 daemon prio=10 os_prio=0 tid=0x0000000058d05000 nid=0x1b78 runnable
> [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x0000000058d00800 nid=0x1430 waiting on condition [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000057916800 nid=0x1968 runnable [0x0000000000000000]
> java.lang.Thread.State: RUNNABLE
>
> Locked ownable synchronizers:
> - None
>
> "Finalizer" #3 daemon prio=8 os_prio=1 tid=0x00000000578b9000 nid=0x1480 in Object.wait() [0x0000000058cff000]
> java.lang.Thread.State: WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
> - locked <0x00000000814947f8> (a java.lang.ref.ReferenceQueue$Lock)
> at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
> at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
>
> Locked ownable synchronizers:
> - None
>
> "Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x00000000578b0000 nid=0x1a1c in Object.wait() [0x0000000058bff000]
> java.lang.Thread.State: WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> at java.lang.Object.wait(Object.java:502)
> at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
> - locked <0x0000000081494838> (a java.lang.ref.Reference$Lock)
>
> Locked ownable synchronizers:
> - None
>
> "VM Thread" os_prio=2 tid=0x00000000578ab000 nid=0x1878 runnable
>
> "GC task thread#0 (ParallelGC)" os_prio=0 tid=0x000000000245e000 nid=0x1914 runnable
>
> "GC task thread#1 (ParallelGC)" os_prio=0 tid=0x000000000245f800 nid=0x844 runnable
>
> "GC task thread#2 (ParallelGC)" os_prio=0 tid=0x0000000002461000 nid=0x1840 runnable
>
> "GC task thread#3 (ParallelGC)" os_prio=0 tid=0x0000000002462800 nid=0x1abc runnable
>
> "VM Periodic Task Thread" os_prio=2 tid=0x0000000058d8e000 nid=0x2e4 waiting on condition
>
> JNI global references: 6393
>
>
> Does anyone of you have any hint what those two teneo threads are good for and why they are not terminating?
>
> Thanks for any hint.
>
> Regards
> Timo
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
Re: [Teneo] Waiting Teneo Threads Prevent JVM From Shutting Down [message #1696281 is a reply to message #1696280] |
Mon, 25 May 2015 08:58 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Timo,
As it was a simple change I did it already yesterday evening and published a new build. Can you try and let me know if
it worked?
Otherwise I have to think on somehow calling the shutdownnow method on the service, but not sure what hook I can use for
that (in a webapp there is the context shutdown, but not sure if there is anything for the jvm).
gr. Martin
On 25-05-15 10:54, Timo Rohrberg wrote:
> Hi Martin,
>
> thanks for your reply. You're right: We also figured on friday that the third thread named "EMF Reference Cleaner" is a
> daemon and should not prevent the JVM from shutting down. So I guess, it's only the two Teneo threads which are not
> daemons and are waiting for a semaphore. Our analysis revealed that the two threads are scheduled regularly via an
> Executor and this regular activation is done with a semaphore. However, it seems that the Executor is never shutdown
> correctly (calling its shutdown method) and thus does not terminate executing these two threads regularly. However,
> making the threads daemon threads should also solve the problem.
>
> I opened a bug (468151) here:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=468151
>
> I am really looking forward for this issue to be fixed.
>
> Thank you so much.
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
Re: [Teneo] Waiting Teneo Threads Prevent JVM From Shutting Down [message #1696301 is a reply to message #1696292] |
Mon, 25 May 2015 10:56 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Timo,
Hmm I use thunderbird as email/news client and apparently your reply does not get downloaded or maybe the sync between
the forum and newsgroup is not fine...
In any case I did not see your reply on that one. Seems like an easy one, will check it and solve it.
gr. Martin
On 25-05-15 12:14, Timo Rohrberg wrote:
> Hi Martin,
>
> ah yes, I already wondered why there was a new version of Teneo available on the download site. Well, I'm not in the
> office today due to a holiday in Germany. I'll be back tomorrow and will try it right away tomorrow morning. I'll give
> you some feedback here, ok?
>
> Thank you very much for your help.
>
> By the way, did you notice my latest reply on the other thread concerning logging with Teneo/Hibernate a couple of days
> ago (https://www.eclipse.org/forums/index.php/t/1066404/)? Maybe you could adapt that change as well if it is reasonable
> for others, too - and I guess it is.
>
> Regards
> Timo
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
|
Powered by
FUDForum. Page generated in 0.03771 seconds