Hi thanks for the answer. I understand but why the sessions didn't complete?, I want to understand in which case this can appears. I tried more time and sometime its works. The server stops really quickly. Must I call Session.close() before I dispose the acceptor?
-----Original Message----- From: Emmanuel Lécharny [mailto:elecha...@gmail.com] Sent: Friday, June 24, 2016 12:56 PM To: users@mina.apache.org Subject: Re: Acceptor dispose block indefinitely Le 24/06/16 à 10:50, Simo Chiegang, Boris Arthur a écrit : > I Guys, > > I have a server and I called to stop the server: > > Acceptor.dispose(true); > > But the call never come back. I don't know why: > > java.lang.Thread.State: TIMED_WAITING (parking) > at sun.misc.Unsafe.park(Native Method) > - parking to wait for <0x00000000f94bcd30> (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.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:1465) > at > org.apache.mina.core.service.AbstractIoService.dispose(AbstractIoService.java:307) > at > com.heidelberg.lvis.printdevice.sub.samba3.simu.DummySamba3JsonRpcServer.stop(DummySamba3JsonRpcServer.java:203) > at > test.heidelberg.lvis.printdevice.devices.TestUtilsSamba3.stopHardwareSimulation(TestUtilsSamba3.java:110) > at > test.heidelberg.lvis.printdevice.devices.Samba3HeadTemperatureTest.tea > rDown(Samba3HeadTemperatureTest.java:58) > > I thinks, it must sure that this blocking call come back. Can you tell me in > which case this can indefinitely block?. Because you have explicitely called for it. Passing 'true' tells the dispose to wait for all the sessions to complete : "Releases any resources allocated by this service. Please note that this method might block as long as there are any sessions managed by this service. Warning : calling this method from a IoFutureListener with awaitTermination = true will probably lead to a deadlock." Pass 'false'. ________________________________ Confidentiality note: The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.