-
1. Re: How to shutdown IronJacamar embedded properly ?
maeste Jun 27, 2016 9:11 AM (in response to sewatech)Hi,
which version of IronJacamar are you using? Would you please paste here the result of your println cycle?
Thanks
S.
-
2. Re: How to shutdown IronJacamar embedded properly ?
sewatech Jun 27, 2016 9:43 AM (in response to maeste)Hi Stefano,
I'm using IronJacamar 1.3.4.Final.
Here is my output :
fungal/Listener:55030
[java.net.PlainSocketImpl.socketAccept(Native Method), java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409), java.net.ServerSocket.implAccept(ServerSocket.java:545), java.net.ServerSocket.accept(ServerSocket.java:513), com.arjuna.ats.internal.arjuna.recovery.Listener.run(Listener.java:122)]
fungal/pool-1-thread-1
[sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:175), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617), java.lang.Thread.run(Thread.java:745)]
fungal/Transaction Reaper
[java.lang.Object.wait(Native Method), com.arjuna.ats.internal.arjuna.coordinator.ReaperThread.run(ReaperThread.java:90)]
fungal/Transaction Reaper Worker 0
[java.lang.Object.wait(Native Method), java.lang.Object.wait(Object.java:502), com.arjuna.ats.arjuna.coordinator.TransactionReaper.waitForCancellations(TransactionReaper.java:328), com.arjuna.ats.internal.arjuna.coordinator.ReaperWorkerThread.run(ReaperWorkerThread.java:65)]
system/RMI TCP Accept-0
[java.net.PlainSocketImpl.socketAccept(Native Method), java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409), java.net.ServerSocket.implAccept(ServerSocket.java:545), java.net.ServerSocket.accept(ServerSocket.java:513), sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:400), sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:372), java.lang.Thread.run(Thread.java:745)]
It appears that fungal/pool-1-thread-1 is the only non-daemon one.
Alexis
-
3. Re: How to shutdown IronJacamar embedded properly ?
sewatech Jun 27, 2016 10:00 AM (in response to sewatech)In the meanwhile, I've tried some workaround.
First with some code :
ThreadPoolExecutor lookupPool = embedded.lookup("LookupPool", ThreadPoolExecutor.class); embedded.shutdown(); lookupPool.shutdown();
Or with some configuration, and redefining the naming.xml file, and adding a destroy element on the LookupPool bean :
<bean name="LookupPool"> <constructor factoryMethod="newFixedThreadPool" factoryClass="java.util.concurrent.Executors"> <parameter>2</parameter> </constructor> <destroy method="shutdown"/> </bean>
Both solutions seem to be working, but I've no idea whether it have side effects.
Alexis
-
4. Re: How to shutdown IronJacamar embedded properly ?
jesper.pedersen Jun 27, 2016 10:22 AM (in response to sewatech)Yes, beans backed by a thread pool should have the "<destroy method="shutdown"/>" element defined.
Feel free to open a JBJCA JIRA for this, and thanks for investigating !
-
5. Re: How to shutdown IronJacamar embedded properly ?
sewatech Jun 27, 2016 10:55 AM (in response to jesper.pedersen) -
6. Re: How to shutdown IronJacamar embedded properly ?
maeste Jul 8, 2016 12:13 PM (in response to sewatech)Merged your PR on master
https://github.com/ironjacamar/ironjacamar/commit/c8a331d1f5b0b1df60bcbae1cfb3a424f4cbb453
and backported also into 1.2 branch
https://github.com/ironjacamar/ironjacamar/commit/76d07d21e97eae656246f213fce0ba3caf520fc5
Thanks for the interest and PR
regards
S.